GUAC-1170: Move modules back to separate packages.

This commit is contained in:
Michael Jumper
2015-04-26 20:58:36 -07:00
parent fad3263909
commit 81abdd0d3d
8 changed files with 17 additions and 50 deletions

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.net.basic.inject; package org.glyptodon.guacamole.net.basic;
import com.google.inject.Guice; import com.google.inject.Guice;
import com.google.inject.Injector; import com.google.inject.Injector;
@@ -30,6 +30,9 @@ import javax.servlet.ServletContextEvent;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.environment.Environment; import org.glyptodon.guacamole.environment.Environment;
import org.glyptodon.guacamole.environment.LocalEnvironment; import org.glyptodon.guacamole.environment.LocalEnvironment;
import org.glyptodon.guacamole.net.basic.log.LogModule;
import org.glyptodon.guacamole.net.basic.rest.RESTAuthModule;
import org.glyptodon.guacamole.net.basic.rest.RESTServletModule;
import org.glyptodon.guacamole.net.basic.rest.auth.BasicTokenSessionMap; import org.glyptodon.guacamole.net.basic.rest.auth.BasicTokenSessionMap;
import org.glyptodon.guacamole.net.basic.rest.auth.TokenSessionMap; import org.glyptodon.guacamole.net.basic.rest.auth.TokenSessionMap;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -77,12 +80,11 @@ public class BasicServletContextListener extends GuiceServletContextListener {
@Override @Override
protected Injector getInjector() { protected Injector getInjector() {
return Guice.createInjector( return Guice.createInjector(Stage.PRODUCTION,
Stage.PRODUCTION,
new EnvironmentModule(environment), new EnvironmentModule(environment),
new LogModule(environment), new LogModule(environment),
new AuthenticationModule(environment, sessionMap), new RESTAuthModule(environment, sessionMap),
new RESTModule(), new RESTServletModule(),
new TunnelModule() new TunnelModule()
); );
} }

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.net.basic.inject; package org.glyptodon.guacamole.net.basic;
import com.google.inject.AbstractModule; import com.google.inject.AbstractModule;
import org.glyptodon.guacamole.environment.Environment; import org.glyptodon.guacamole.environment.Environment;

View File

@@ -20,15 +20,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.net.basic.inject; package org.glyptodon.guacamole.net.basic;
import com.google.inject.servlet.ServletModule; import com.google.inject.servlet.ServletModule;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.basic.BasicGuacamoleTunnelServlet;
import org.glyptodon.guacamole.net.basic.GuacamoleClassLoader;
import org.glyptodon.guacamole.net.basic.TunnelLoader;
import org.glyptodon.guacamole.net.basic.TunnelRequestService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@@ -1,27 +0,0 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Dependency injection classes specific to the Guacamole web application.
*/
package org.glyptodon.guacamole.net.basic.inject;

View File

@@ -20,7 +20,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.net.basic.inject; package org.glyptodon.guacamole.net.basic.log;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator; import ch.qos.logback.classic.joran.JoranConfigurator;

View File

@@ -20,10 +20,9 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.net.basic.inject; package org.glyptodon.guacamole.net.basic.rest;
import com.google.inject.AbstractModule; import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.environment.Environment; import org.glyptodon.guacamole.environment.Environment;
import org.glyptodon.guacamole.net.auth.AuthenticationProvider; import org.glyptodon.guacamole.net.auth.AuthenticationProvider;
@@ -41,12 +40,12 @@ import org.slf4j.LoggerFactory;
* @author James Muehlner * @author James Muehlner
* @author Michael Jumper * @author Michael Jumper
*/ */
public class AuthenticationModule extends AbstractModule { public class RESTAuthModule extends AbstractModule {
/** /**
* Logger for this class. * Logger for this class.
*/ */
private final Logger logger = LoggerFactory.getLogger(AuthenticationModule.class); private final Logger logger = LoggerFactory.getLogger(RESTAuthModule.class);
/** /**
* The Guacamole server environment. * The Guacamole server environment.
@@ -69,7 +68,7 @@ public class AuthenticationModule extends AbstractModule {
* An instance of TokenSessionMap to inject as a singleton wherever * An instance of TokenSessionMap to inject as a singleton wherever
* needed. * needed.
*/ */
public AuthenticationModule(Environment environment, public RESTAuthModule(Environment environment,
TokenSessionMap tokenSessionMap) { TokenSessionMap tokenSessionMap) {
this.environment = environment; this.environment = environment;
this.tokenSessionMap = tokenSessionMap; this.tokenSessionMap = tokenSessionMap;

View File

@@ -20,16 +20,13 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package org.glyptodon.guacamole.net.basic.inject; package org.glyptodon.guacamole.net.basic.rest;
import com.google.inject.Scopes; import com.google.inject.Scopes;
import com.google.inject.matcher.Matchers; import com.google.inject.matcher.Matchers;
import com.google.inject.servlet.ServletModule; import com.google.inject.servlet.ServletModule;
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
import org.codehaus.jackson.jaxrs.JacksonJsonProvider; import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.glyptodon.guacamole.net.basic.rest.AuthProviderRESTExceptionWrapper;
import org.glyptodon.guacamole.net.basic.rest.AuthProviderRESTExposure;
import org.glyptodon.guacamole.net.basic.rest.ObjectRetrievalService;
import org.glyptodon.guacamole.net.basic.rest.auth.TokenRESTService; import org.glyptodon.guacamole.net.basic.rest.auth.TokenRESTService;
import org.glyptodon.guacamole.net.basic.rest.clipboard.ClipboardRESTService; import org.glyptodon.guacamole.net.basic.rest.clipboard.ClipboardRESTService;
import org.glyptodon.guacamole.net.basic.rest.connection.ConnectionRESTService; import org.glyptodon.guacamole.net.basic.rest.connection.ConnectionRESTService;
@@ -44,7 +41,7 @@ import org.glyptodon.guacamole.net.basic.rest.user.UserRESTService;
* *
* @author James Muehlner * @author James Muehlner
*/ */
public class RESTModule extends ServletModule { public class RESTServletModule extends ServletModule {
@Override @Override
protected void configureServlets() { protected void configureServlets() {

View File

@@ -42,7 +42,7 @@
</filter-mapping> </filter-mapping>
<listener> <listener>
<listener-class>org.glyptodon.guacamole.net.basic.inject.BasicServletContextListener</listener-class> <listener-class>org.glyptodon.guacamole.net.basic.BasicServletContextListener</listener-class>
</listener> </listener>
<!-- Audio file mimetype mappings --> <!-- Audio file mimetype mappings -->