You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/09/30 12:06:30 UTC
svn commit: r580689 - in /geronimo/sandbox/gshell/trunk: ./
gshell-command-api/ gshell-core/ gshell-embeddable/ gshell-parser/
gshell-remote/ gshell-remote/gshell-remote-common/
gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshel...
Author: jdillon
Date: Sun Sep 30 03:06:25 2007
New Revision: 580689
URL: http://svn.apache.org/viewvc?rev=580689&view=rev
Log:
Split up the server's handling of messages into smaller handler classes
Updating the base iohandler to automatically give the handler its session context
Added:
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java (with props)
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java (with props)
Removed:
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerHandler.java
Modified:
geronimo/sandbox/gshell/trunk/gshell-command-api/pom.xml
geronimo/sandbox/gshell/trunk/gshell-core/pom.xml
geronimo/sandbox/gshell/trunk/gshell-embeddable/pom.xml
geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteShellContainer.java
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java
geronimo/sandbox/gshell/trunk/gshell-remote/pom.xml
geronimo/sandbox/gshell/trunk/gshell-support/pom.xml
geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml
geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/message/MessageHandlerSupport.java
geronimo/sandbox/gshell/trunk/pom.xml
Modified: geronimo/sandbox/gshell/trunk/gshell-command-api/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-command-api/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-command-api/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-command-api/pom.xml Sun Sep 30 03:06:25 2007
@@ -82,18 +82,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
Modified: geronimo/sandbox/gshell/trunk/gshell-core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/pom.xml Sun Sep 30 03:06:25 2007
@@ -70,12 +70,7 @@
<artifactId>commons-jexl</artifactId>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
-
+ <!-- Required for commons-jexl usage -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl104-over-slf4j</artifactId>
Modified: geronimo/sandbox/gshell/trunk/gshell-embeddable/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-embeddable/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-embeddable/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-embeddable/pom.xml Sun Sep 30 03:06:25 2007
@@ -65,7 +65,12 @@
<configuration>
<artifactSet>
<excludes>
+ <!--
+ FIXME: For some reason we get test scope stuff in here... so exclude them
+ -->
+ <exclude>org.slf4j:slf4j-simple</exclude>
<exclude>junit:junit</exclude>
+ <exclude>org.apache.geronimo.genesis.config:logging-config</exclude>
</excludes>
</artifactSet>
<!--
Modified: geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml Sun Sep 30 03:06:25 2007
@@ -47,18 +47,6 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
<!--
<dependency>
Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml Sun Sep 30 03:06:25 2007
@@ -43,6 +43,11 @@
<artifactId>gshell-whisper</artifactId>
<version>${version}</version>
</dependency>
+
+ <dependency>
+ <groupId>blissed</groupId>
+ <artifactId>blissed</artifactId>
+ </dependency>
</dependencies>
<build>
Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java Sun Sep 30 03:06:25 2007
@@ -19,11 +19,6 @@
package org.apache.geronimo.gshell.remote.server;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-
-import org.apache.geronimo.gshell.branding.Branding;
import org.apache.geronimo.gshell.command.CommandExecutor;
import org.apache.geronimo.gshell.remote.RemoteShell;
import org.apache.geronimo.gshell.shell.Environment;
@@ -31,9 +26,6 @@
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.InstantiationStrategy;
import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
-import org.codehaus.plexus.util.IOUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,7 +36,7 @@
*/
@Component(role=RemoteShell.class, instantiationStrategy=InstantiationStrategy.PER_LOOKUP)
public class DefaultRemoteShell
- implements RemoteShell, Initializable
+ implements RemoteShell
{
private final Logger log = LoggerFactory.getLogger(getClass());
@@ -52,9 +44,6 @@
private ShellInfo shellInfo;
@Requirement
- private Branding branding;
-
- @Requirement
private CommandExecutor executor;
@Requirement
@@ -90,20 +79,6 @@
return shellInfo;
}
- public void initialize() throws InitializationException {
- /*
-
- FIXME: Client needs to request this to be done... ?
-
- try {
- loadProfileScripts();
- }
- catch (Exception e) {
- throw new InitializationException(e.getMessage(), e);
- }
- */
- }
-
//
// Command Execution (all delegates)
//
@@ -127,68 +102,6 @@
}
//
- // Script Processing
+ // TODO: Hookup profile script processing bits
//
-
- private void loadProfileScripts() throws Exception {
- //
- // TODO: Load gsh.properties if it exists?
- //
-
- // Load profile scripts if they exist
- loadSharedScript(branding.getProfileScriptName());
- loadUserScript(branding.getProfileScriptName());
- }
-
- private void loadScript(final File file) throws Exception {
- assert file != null;
-
- //
- // FIXME: Don't use 'source 'for right now, the shell spins out of control from plexus component loading :-(
- //
- // execute("source", file.toURI().toURL());
-
- BufferedReader reader = new BufferedReader(new FileReader(file));
-
- try {
- String line;
-
- while ((line = reader.readLine()) != null) {
- execute(line);
- }
- }
- finally {
- IOUtil.close(reader);
- }
- }
-
- private void loadUserScript(final String fileName) throws Exception {
- assert fileName != null;
-
- File file = new File(branding.getUserDirectory(), fileName);
-
- if (file.exists()) {
- log.debug("Loading user-script: {}", file);
-
- loadScript(file);
- }
- else {
- log.debug("User script is not present: {}", file);
- }
- }
-
- private void loadSharedScript(final String fileName) throws Exception {
- assert fileName != null;
-
- File file = new File(branding.getSharedDirectory(), fileName);
-
- if (file.exists()) {
- log.debug("Loading shared-script: {}", file);
-
- loadScript(file);
- }
- else {
- log.debug("Shared script is not present: {}", file);
- }
- }
}
Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteShellContainer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteShellContainer.java?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteShellContainer.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteShellContainer.java Sun Sep 30 03:06:25 2007
@@ -21,7 +21,6 @@
import java.util.UUID;
-import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
@@ -36,8 +35,6 @@
public class RemoteShellContainer
extends DefaultPlexusContainer
{
- public static final SessionAttributeBinder<RemoteShellContainer> BINDER = new SessionAttributeBinder<RemoteShellContainer>(RemoteShellContainer.class);
-
public RemoteShellContainer(final ContainerConfiguration config) throws PlexusContainerException {
super(config);
}
Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java Sun Sep 30 03:06:25 2007
@@ -20,46 +20,23 @@
package org.apache.geronimo.gshell.remote.server;
import java.net.URI;
-import java.security.PublicKey;
-import java.util.UUID;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadFactory;
+import java.util.List;
import java.util.concurrent.TimeUnit;
-import org.apache.geronimo.gshell.DefaultEnvironment;
import org.apache.geronimo.gshell.common.Duration;
-import org.apache.geronimo.gshell.common.NamedThreadFactory;
-import org.apache.geronimo.gshell.common.Notification;
-import org.apache.geronimo.gshell.common.tostring.ToStringBuilder;
-import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
-import org.apache.geronimo.gshell.lookup.EnvironmentLookup;
-import org.apache.geronimo.gshell.lookup.IOLookup;
-import org.apache.geronimo.gshell.remote.RemoteShell;
-import org.apache.geronimo.gshell.remote.crypto.CryptoContext;
-import org.apache.geronimo.gshell.remote.message.CloseShellMessage;
-import org.apache.geronimo.gshell.remote.message.ConnectMessage;
-import org.apache.geronimo.gshell.remote.message.EchoMessage;
-import org.apache.geronimo.gshell.remote.message.ExecuteMessage;
-import org.apache.geronimo.gshell.remote.message.LoginMessage;
-import org.apache.geronimo.gshell.remote.message.OpenShellMessage;
-import org.apache.geronimo.gshell.remote.message.RshMessage;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.remote.server.handler.ServerMessageHandler;
+import org.apache.geronimo.gshell.remote.server.handler.ServerSessionContext;
+import org.apache.geronimo.gshell.remote.server.timeout.TimeoutManager;
import org.apache.geronimo.gshell.whisper.message.MessageHandler;
-import org.apache.geronimo.gshell.whisper.message.MessageHandlerSupport;
-import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
import org.apache.geronimo.gshell.whisper.transport.TransportFactoryLocator;
import org.apache.geronimo.gshell.whisper.transport.TransportServer;
import org.apache.mina.common.IoSession;
import org.apache.mina.handler.demux.DemuxingIoHandler;
import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.classworlds.ClassWorld;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.InstantiationStrategy;
import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,34 +47,20 @@
*/
@Component(role=RshServer.class, instantiationStrategy=InstantiationStrategy.PER_LOOKUP)
public class RshServer
- implements Initializable
{
private final Logger log = LoggerFactory.getLogger(getClass());
@Requirement
private PlexusContainer container;
- private ClassWorld classWorld;
-
- private ScheduledThreadPoolExecutor scheduler;
-
@Requirement
- private CryptoContext crypto;
+ private TimeoutManager timeoutManager;
@Requirement
private TransportFactoryLocator locator;
private TransportServer server;
- private final UUID securityToken = UUID.randomUUID();
-
- public void initialize() throws InitializationException {
- classWorld = container.getContainerRealm().getWorld();
-
- ThreadFactory tf = new NamedThreadFactory(getClass());
- scheduler = new ScheduledThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), tf);
- }
-
public void bind(final URI location) throws Exception {
TransportFactory factory = locator.locate(location);
@@ -110,356 +73,74 @@
server.close();
}
- //
- // SessionState
- //
-
- /**
- * Session binding helper for {@link SessionState} instances.
- */
- private static final SessionAttributeBinder<SessionState> SESSION_STATE = new SessionAttributeBinder<SessionState>(SessionState.class);
-
- /**
- * Container for various bits of state we are tracking.
- */
- private class SessionState
- {
- /** The remote client's unique identifier. */
- public final UUID id = UUID.randomUUID();
-
- /** The remove client's public key. */
- public PublicKey pk;
-
- /** The shared security token */
- public UUID sectoken;
-
- /** The remote client's logged in username. */
- public String username;
-
- /** The container which the remote shell is running in. */
- public RemoteShellContainer container;
-
- /** The I/O context for the remote shell. */
- public RemoteIO io;
-
- /** The environment for the remote shell. */
- public Environment env;
-
- /** The remote shell instance. */
- public RemoteShell shell;
-
- public void destroy() {
- shell.close();
-
- container.disposeAllComponents();
- }
-
- public int hashCode() {
- return id.hashCode();
- }
-
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
- .append("id", id)
- .append("username", username)
- .toString();
- }
- }
+ public static final Duration AUTH_TIMEOUT = new Duration(10, TimeUnit.SECONDS);
private class ServerHandler
extends DemuxingIoHandler
{
public ServerHandler() throws Exception {
- register(new ConnectHandler());
- register(new LoginHandler());
- register(new OpenShellHandler());
- register(new CloseShellHandler());
- register(new ExecuteHandler());
- register(new EchoHandler());
+ // noinspection unchecked
+ List<ServerMessageHandler> handlers = (List<ServerMessageHandler>)container.lookupList(ServerMessageHandler.class);
+
+ // Complain if we don't have any handlers
+ if (handlers.isEmpty()) {
+ throw new Error("No server message handlers were discovered");
+ }
+
+ for (ServerMessageHandler handler : handlers) {
+
+ register(handler);
+ }
}
public void register(final MessageHandler handler) {
assert handler != null;
- addMessageHandler(handler.getType(), handler);
+ Class<?> type = handler.getType();
+
+ log.debug("Registering handler: {} for type: {}", handler, type);
+
+ // noinspection unchecked
+ addMessageHandler(type, handler);
}
- /*
@Override
- public void messageReceived(final IoSession session, final Object obj) throws Exception {
+ public void messageReceived(final IoSession session, final Object message) throws Exception {
assert session != null;
- assert obj != null;
-
- SessionState state = SESSION_STATE.lookup(session, null);
+ assert message != null;
- if (state != null && securityToken.equals(state.sectoken)) {
- log.debug("Message is already authenticated");
-
- super.messageReceived(session, obj);
- }
- else if (obj instanceof HandshakeMessage) {
- log.debug("Message requires handshake/authentication");
-
- super.messageReceived(session, obj);
- }
- else {
- // If we get to here, then the message is not valid, so complain, then kill the session
- log.error("Invalid message: {}", obj);
-
- //
- // TODO: See if we can just toss an IOException here instead?
- //
-
- session.close();
- }
+ //
+ // TODO: Insert some security checking here, or really, make a filter to handle that...
+ //
+
+ super.messageReceived(session, message);
}
- */
@Override
public void sessionOpened(final IoSession session) throws Exception {
assert session != null;
+ // Install the session context
+ ServerSessionContext context = ServerSessionContext.BINDER.bind(session, new ServerSessionContext());
+ log.debug("Created session context: {}", context.id);
+
// Schedule a task to timeout the handshake process
- scheduleTimeout(session, AUTH_TIMEOUT);
+ timeoutManager.scheduleTimeout(session, AUTH_TIMEOUT, new Runnable() {
+ public void run() {
+ log.error("Timeout waiting for handshake from: {}", session.getRemoteAddress());
+
+ session.close();
+ }
+ });
}
@Override
public void sessionClosed(final IoSession session) throws Exception {
assert session != null;
- SessionState state = SESSION_STATE.unbind(session);
-
- // If there is still state bound then clean it up
- if (state != null) {
- log.warn("Delinquent state detected: {}", state);
-
- try {
- state.destroy();
- }
- catch (Exception e) {
- log.warn("Failed to clean up after delinquent state", e);
- }
- }
+ ServerSessionContext context = ServerSessionContext.BINDER.unbind(session);
+ log.debug("Removed session context: {}", context.id);
}
}
- private class ConnectHandler
- extends MessageHandlerSupport<ConnectMessage>
- {
- public ConnectHandler() {
- super(RshMessage.Type.CONNECT);
- }
-
- public void messageReceived(IoSession session, ConnectMessage message) throws Exception {
- // Try to cancel the timeout task
- if (!cancelTimeout(session)) {
- log.warn("Aborting handshake processing; timeout has triggered");
- }
- else {
- // Setup the initial client state
- SessionState state = SESSION_STATE.bind(session, new SessionState());
- log.info("Initiating state for client: {}", state.id);
-
- // Hold on to the client's public key
- state.pk = message.getPublicKey();
-
- // Reply to the client with some details about the connection
- ConnectMessage.Result reply = new ConnectMessage.Result(state.id, crypto.getPublicKey());
- reply.setCorrelationId(message.getId());
- session.write(reply);
-
- // Schedule a task to timeout the login process
- scheduleTimeout(session, AUTH_TIMEOUT);
- }
- }
- }
-
- private class LoginHandler
- extends MessageHandlerSupport<LoginMessage>
- {
- protected LoginHandler() {
- super(RshMessage.Type.LOGIN);
- }
-
- public void messageReceived(IoSession session, LoginMessage message) throws Exception {
- // Try to cancel the timeout task
- if (!cancelTimeout(session)) {
- log.warn("Aborting login processing; timeout has triggered");
- }
- else {
- String username = message.getUsername();
- String password = message.getPassword();
-
- SessionState state = SESSION_STATE.lookup(session);
-
- //
- // TODO: Implement something else...
- //
-
- // Mark the session as authenticated (which is done by setting the sectoken)
- state.sectoken = securityToken;
-
- // Remember our username
- state.username = username;
-
- log.info("Successfull authentication for user: {}, at location: {}", username, session.getRemoteAddress());
-
- LoginMessage.Success reply = new LoginMessage.Success();
- reply.setCorrelationId(message.getId());
- session.write(reply);
- }
- }
- }
-
- private class OpenShellHandler
- extends MessageHandlerSupport<OpenShellMessage>
- {
- protected OpenShellHandler() {
- super(RshMessage.Type.OPEN_SHELL);
- }
-
- public void messageReceived(IoSession session, OpenShellMessage message) throws Exception {
- SessionState state = SESSION_STATE.lookup(session);
-
- // Create a new container which will be the parent for our remote shells
- state.container = RemoteShellContainer.create(classWorld);
-
- // Setup the I/O context (w/o auto-flushing)
- state.io = new RemoteIO(session);
- IOLookup.set(state.container, state.io);
-
- // Setup shell environemnt
- state.env = new DefaultEnvironment(state.io);
- EnvironmentLookup.set(state.container, state.env);
-
- // Create a new shell instance
- state.shell = (RemoteShell) state.container.lookup(RemoteShell.class);
-
- //
- // TODO: Send a meaningful response
- //
-
- EchoMessage reply = new EchoMessage("OPEN SHELL SUCCESS");
- reply.setCorrelationId(message.getId());
- session.write(reply);
- }
- }
-
- private class CloseShellHandler
- extends MessageHandlerSupport<CloseShellMessage>
- {
- protected CloseShellHandler() {
- super(RshMessage.Type.CLOSE_SHELL);
- }
-
- public void messageReceived(IoSession session, CloseShellMessage message) throws Exception {
- SessionState state = SESSION_STATE.unbind(session);
-
- //
- // TODO: This should just clean up the bits related to shell muck...
- //
-
- state.destroy();
-
- //
- // TODO: Send a meaningful response
- //
-
- EchoMessage reply = new EchoMessage("CLOSE SHELL SUCCESS");
- reply.setCorrelationId(message.getId());
- session.write(reply);
- }
- }
-
- private class ExecuteHandler
- extends MessageHandlerSupport<ExecuteMessage>
- {
- protected ExecuteHandler() {
- super(RshMessage.Type.EXECUTE);
- }
-
- public void messageReceived(IoSession session, ExecuteMessage message) throws Exception {
- SessionState state = SESSION_STATE.lookup(session);
-
- // Need to make sure that the execuing thread has the right I/O and environment in context
- IOLookup.set(state.container, state.io);
- EnvironmentLookup.set(state.container, state.env);
-
- ExecuteMessage.Result reply;
-
- try {
- Object result = message.execute(state.shell);
-
- log.debug("Result: {}", result);
-
- reply = new ExecuteMessage.Result(result);
- }
- catch (Notification n) {
- log.debug("Notification: " + n);
-
- reply = new ExecuteMessage.Notification(n);
- }
- catch (Throwable t) {
- log.debug("Fault: " + t);
-
- reply = new ExecuteMessage.Fault(t);
- }
-
- reply.setCorrelationId(message.getId());
- session.write(reply);
- }
- }
-
- private class EchoHandler
- extends MessageHandlerSupport<EchoMessage>
- {
- protected EchoHandler() {
- super(RshMessage.Type.ECHO);
- }
-
- public void messageReceived(IoSession session, EchoMessage message) throws Exception {
- EchoMessage reply = new EchoMessage(message.getText());
- reply.setCorrelationId(message.getId());
- session.write(reply);
- }
- }
-
- //
- // Timeout Support
- //
-
- //
- // TODO: Move this timeout stuff to a component, a few things need this functionality, probably more than I can think of too..
- //
-
- private static final SessionAttributeBinder<ScheduledFuture> TIMEOUT_BINDER = new SessionAttributeBinder<ScheduledFuture>(RshServer.class, "timeout");
-
- private static final Duration AUTH_TIMEOUT = new Duration(10, TimeUnit.SECONDS);
-
- private ScheduledFuture scheduleTimeout(final IoSession session, final Duration timeout) {
- assert session != null;
- assert timeout != null;
-
- Runnable task = new Runnable() {
- public void run() {
- log.error("Timeout waiting for handshake or authentication from: {}", session.getRemoteAddress());
-
- session.close();
- }
- };
-
- ScheduledFuture tf = scheduler.schedule(task, timeout.value, timeout.unit);
-
- TIMEOUT_BINDER.rebind(session, tf);
-
- return tf;
- }
-
- private boolean cancelTimeout(final IoSession session) {
- assert session != null;
-
- ScheduledFuture tf = TIMEOUT_BINDER.lookup(session);
-
- return tf.cancel(false);
- }
}
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.remote.message.CloseShellMessage;
+import org.apache.geronimo.gshell.remote.message.EchoMessage;
+import org.apache.geronimo.gshell.remote.message.RshMessage;
+import org.apache.mina.common.IoSession;
+import org.codehaus.plexus.component.annotations.Component;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=ServerMessageHandler.class, hint="close-shell")
+public class CloseShellHandler
+ extends ServerMessageHandlerSupport<CloseShellMessage>
+{
+ public CloseShellHandler() {
+ super(RshMessage.Type.CLOSE_SHELL);
+ }
+
+ public void handle(final IoSession session, final ServerSessionContext context, final CloseShellMessage message) throws Exception {
+ context.shell.close();
+ context.shell = null;
+
+ context.container.disposeAllComponents();
+ context.container = null;
+
+ //
+ // TODO: Send a meaningful response
+ //
+
+ EchoMessage reply = new EchoMessage("CLOSE SHELL SUCCESS");
+ reply.setCorrelationId(message.getId());
+ session.write(reply);
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.remote.crypto.CryptoContext;
+import org.apache.geronimo.gshell.remote.message.ConnectMessage;
+import org.apache.geronimo.gshell.remote.message.RshMessage;
+import org.apache.geronimo.gshell.remote.server.RshServer;
+import org.apache.geronimo.gshell.remote.server.timeout.TimeoutManager;
+import org.apache.mina.common.IoSession;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=ServerMessageHandler.class, hint="connect")
+public class ConnectHandler
+ extends ServerMessageHandlerSupport<ConnectMessage>
+{
+ @Requirement
+ private CryptoContext crypto;
+
+ @Requirement
+ private TimeoutManager timeoutManager;
+
+ public ConnectHandler() {
+ super(RshMessage.Type.CONNECT);
+ }
+
+ public void handle(final IoSession session, final ServerSessionContext context, final ConnectMessage message) throws Exception {
+ // Try to cancel the timeout task
+ if (!timeoutManager.cancelTimeout(session)) {
+ log.warn("Aborting handshake processing; timeout has triggered");
+ }
+ else {
+ // Hold on to the client's public key
+ context.pk = message.getPublicKey();
+
+ // Reply to the client with some details about the connection
+ ConnectMessage.Result reply = new ConnectMessage.Result(context.id, crypto.getPublicKey());
+ reply.setCorrelationId(message.getId());
+ session.write(reply);
+
+ // Schedule a task to timeout the login process
+ timeoutManager.scheduleTimeout(session, RshServer.AUTH_TIMEOUT, new Runnable() {
+ public void run() {
+ log.error("Timeout waiting for login from: {}", session.getRemoteAddress());
+ session.close();
+ }
+ });
+ }
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.remote.message.EchoMessage;
+import org.apache.geronimo.gshell.remote.message.RshMessage;
+import org.apache.mina.common.IoSession;
+import org.codehaus.plexus.component.annotations.Component;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=ServerMessageHandler.class, hint="echo")
+public class EchoHandler
+ extends ServerMessageHandlerSupport<EchoMessage>
+{
+ public EchoHandler() {
+ super(RshMessage.Type.ECHO);
+ }
+
+ public void handle(final IoSession session, final ServerSessionContext context, final EchoMessage message) throws Exception {
+ EchoMessage reply = new EchoMessage(message.getText());
+ reply.setCorrelationId(message.getId());
+ session.write(reply);
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.common.Notification;
+import org.apache.geronimo.gshell.lookup.EnvironmentLookup;
+import org.apache.geronimo.gshell.lookup.IOLookup;
+import org.apache.geronimo.gshell.remote.message.ExecuteMessage;
+import org.apache.geronimo.gshell.remote.message.RshMessage;
+import org.apache.mina.common.IoSession;
+import org.codehaus.plexus.component.annotations.Component;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=ServerMessageHandler.class, hint="execute")
+public class ExecuteHandler
+ extends ServerMessageHandlerSupport<ExecuteMessage>
+{
+ public ExecuteHandler() {
+ super(RshMessage.Type.EXECUTE);
+ }
+
+ public void handle(final IoSession session, final ServerSessionContext context, final ExecuteMessage message) throws Exception {
+ // Need to make sure that the execuing thread has the right I/O and environment in context
+ IOLookup.set(context.container, context.io);
+ EnvironmentLookup.set(context.container, context.env);
+
+ ExecuteMessage.Result reply;
+
+ try {
+ Object result = message.execute(context.shell);
+
+ log.debug("Result: {}", result);
+
+ reply = new ExecuteMessage.Result(result);
+ }
+ catch (Notification n) {
+ log.debug("Notification: " + n);
+
+ reply = new ExecuteMessage.Notification(n);
+ }
+ catch (Throwable t) {
+ log.debug("Fault: " + t);
+
+ reply = new ExecuteMessage.Fault(t);
+ }
+
+ reply.setCorrelationId(message.getId());
+ session.write(reply);
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.remote.message.LoginMessage;
+import org.apache.geronimo.gshell.remote.message.RshMessage;
+import org.apache.geronimo.gshell.remote.server.timeout.TimeoutManager;
+import org.apache.mina.common.IoSession;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=ServerMessageHandler.class, hint="login")
+public class LoginHandler
+ extends ServerMessageHandlerSupport<LoginMessage>
+{
+ @Requirement
+ private TimeoutManager timeoutManager;
+
+ public LoginHandler() {
+ super(RshMessage.Type.LOGIN);
+ }
+
+ public void handle(final IoSession session, final ServerSessionContext context, final LoginMessage message) throws Exception {
+ // Try to cancel the timeout task
+ if (!timeoutManager.cancelTimeout(session)) {
+ log.warn("Aborting login processing; timeout has triggered");
+ }
+ else {
+ String username = message.getUsername();
+ String password = message.getPassword();
+
+ //
+ // TODO: Add JAAC Crapo here...
+ //
+
+ // Remember our username
+ context.username = username;
+
+ log.info("Successfull authentication for user: {}, at location: {}", username, session.getRemoteAddress());
+
+ LoginMessage.Success reply = new LoginMessage.Success();
+ reply.setCorrelationId(message.getId());
+ session.write(reply);
+ }
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.DefaultEnvironment;
+import org.apache.geronimo.gshell.lookup.EnvironmentLookup;
+import org.apache.geronimo.gshell.lookup.IOLookup;
+import org.apache.geronimo.gshell.remote.RemoteShell;
+import org.apache.geronimo.gshell.remote.message.EchoMessage;
+import org.apache.geronimo.gshell.remote.message.OpenShellMessage;
+import org.apache.geronimo.gshell.remote.message.RshMessage;
+import org.apache.geronimo.gshell.remote.server.RemoteIO;
+import org.apache.geronimo.gshell.remote.server.RemoteShellContainer;
+import org.apache.mina.common.IoSession;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.classworlds.ClassWorld;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=ServerMessageHandler.class, hint="open-shell")
+public class OpenShellHandler
+ extends ServerMessageHandlerSupport<OpenShellMessage>
+{
+ @Requirement
+ private PlexusContainer container;
+
+ public OpenShellHandler() {
+ super(RshMessage.Type.OPEN_SHELL);
+ }
+
+ public void handle(final IoSession session, final ServerSessionContext context, final OpenShellMessage message) throws Exception {
+ // Create a new container which will be the parent for our remote shells
+ ClassWorld classWorld = container.getContainerRealm().getWorld();
+ context.container = RemoteShellContainer.create(classWorld);
+
+ // Setup the I/O context (w/o auto-flushing)
+ context.io = new RemoteIO(session);
+ IOLookup.set(context.container, context.io);
+
+ // Setup shell environemnt
+ context.env = new DefaultEnvironment(context.io);
+ EnvironmentLookup.set(context.container, context.env);
+
+ // Create a new shell instance
+ context.shell = (RemoteShell) context.container.lookup(RemoteShell.class);
+
+ //
+ // TODO: Send a meaningful response
+ //
+
+ EchoMessage reply = new EchoMessage("OPEN SHELL SUCCESS");
+ reply.setCorrelationId(message.getId());
+ session.write(reply);
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,16 @@
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.whisper.message.Message;
+import org.apache.geronimo.gshell.whisper.message.MessageHandler;
+import org.apache.mina.common.IoSession;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ServerMessageHandler<T extends Message>
+ extends MessageHandler<T>
+{
+ void handle(final IoSession session, final ServerSessionContext context, final T message) throws Exception;
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,27 @@
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import org.apache.geronimo.gshell.whisper.message.Message;
+import org.apache.geronimo.gshell.whisper.message.MessageHandlerSupport;
+import org.apache.mina.common.IoSession;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class ServerMessageHandlerSupport<T extends Message>
+ extends MessageHandlerSupport<T>
+ implements ServerMessageHandler<T>
+{
+ protected ServerMessageHandlerSupport(final Message.Type type) {
+ super(type);
+ }
+
+ public void messageReceived(final IoSession session, final T message) throws Exception {
+ log.debug("Processing: {}", message);
+
+ ServerSessionContext context = ServerSessionContext.BINDER.lookup(session);
+
+ handle(session, context, message);
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.handler;
+
+import java.security.PublicKey;
+import java.util.UUID;
+
+import org.apache.geronimo.gshell.common.tostring.ToStringBuilder;
+import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
+import org.apache.geronimo.gshell.remote.RemoteShell;
+import org.apache.geronimo.gshell.remote.server.RemoteIO;
+import org.apache.geronimo.gshell.remote.server.RemoteShellContainer;
+import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServerSessionContext
+{
+ public static final SessionAttributeBinder<ServerSessionContext> BINDER = new SessionAttributeBinder<ServerSessionContext>(ServerSessionContext.class);
+
+ /** The session id. */
+ public final UUID id = UUID.randomUUID();
+
+ /** The remote client's public key. */
+ public PublicKey pk;
+
+ /** The remote client's logged in username. */
+ public String username;
+
+ /** The container which the remote shell is running in. */
+ public RemoteShellContainer container;
+
+ /** The I/O context for the remote shell. */
+ public RemoteIO io;
+
+ /** The environment for the remote shell. */
+ public Environment env;
+
+ /** The remote shell instance. */
+ public RemoteShell shell;
+
+ public int hashCode() {
+ return id.hashCode();
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+ .append("id", id)
+ .toString();
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.gshell.remote.server.timeout;
+
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+
+import org.apache.geronimo.gshell.common.Duration;
+import org.apache.geronimo.gshell.common.NamedThreadFactory;
+import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
+import org.apache.mina.common.IoSession;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=TimeoutManager.class)
+public class DefaultTimeoutManager
+ implements TimeoutManager, Initializable
+{
+ private static final SessionAttributeBinder<ScheduledFuture> TIMEOUT = new SessionAttributeBinder<ScheduledFuture>(TimeoutManager.class, "timeout");
+
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ private ScheduledThreadPoolExecutor scheduler;
+
+ public void initialize() throws InitializationException {
+ ThreadFactory tf = new NamedThreadFactory(getClass());
+ scheduler = new ScheduledThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), tf);
+ }
+
+ public ScheduledFuture scheduleTimeout(final IoSession session, final Duration timeout, final Runnable task) {
+ assert session != null;
+ assert timeout != null;
+ assert task != null;
+
+ ScheduledFuture tf = scheduler.schedule(task, timeout.value, timeout.unit);
+
+ TIMEOUT.rebind(session, tf);
+
+ return tf;
+ }
+
+ public boolean cancelTimeout(final IoSession session) {
+ assert session != null;
+
+ ScheduledFuture tf = TIMEOUT.lookup(session);
+
+ return tf.cancel(false);
+ }
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java?rev=580689&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java Sun Sep 30 03:06:25 2007
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.remote.server.timeout;
+
+import java.util.concurrent.ScheduledFuture;
+
+import org.apache.geronimo.gshell.common.Duration;
+import org.apache.mina.common.IoSession;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public interface TimeoutManager
+{
+ ScheduledFuture scheduleTimeout(IoSession session, Duration timeout, Runnable task);
+
+ boolean cancelTimeout(IoSession session);
+}
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/sandbox/gshell/trunk/gshell-remote/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/pom.xml Sun Sep 30 03:06:25 2007
@@ -39,6 +39,22 @@
Support for remote access in GShell.
</description>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.mina</groupId>
+ <artifactId>mina-core</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.mina</groupId>
+ <artifactId>mina-filter-ssl</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.apache.geronimo.gshell</groupId>
@@ -69,13 +85,11 @@
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
- <version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-filter-ssl</artifactId>
- <version>1.1.2</version>
</dependency>
<dependency>
Modified: geronimo/sandbox/gshell/trunk/gshell-support/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-support/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-support/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-support/pom.xml Sun Sep 30 03:06:25 2007
@@ -46,19 +46,5 @@
<module>gshell-i18n</module>
<module>gshell-prefs</module>
</modules>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
+
</project>
Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml Sun Sep 30 03:06:25 2007
@@ -79,18 +79,6 @@
<artifactId>plexus-container-default</artifactId>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/message/MessageHandlerSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/message/MessageHandlerSupport.java?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/message/MessageHandlerSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/message/MessageHandlerSupport.java Sun Sep 30 03:06:25 2007
@@ -41,6 +41,7 @@
}
public Class<T> getType() {
+ // noinspection unchecked
return (Class<T>) type.getType();
}
}
Modified: geronimo/sandbox/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/pom.xml?rev=580689&r1=580688&r2=580689&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/pom.xml Sun Sep 30 03:06:25 2007
@@ -87,7 +87,13 @@
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
-
+
+ <dependency>
+ <groupId>blissed</groupId>
+ <artifactId>blissed</artifactId>
+ <version>1.0-beta-3</version>
+ </dependency>
+
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
@@ -167,6 +173,20 @@
</dependency>
</dependencies>
</dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
<build>
<pluginManagement>