org.exolab.jms.server.mipc
Class IpcServerChannel

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.exolab.jms.server.mipc.IpcServerChannel
All Implemented Interfaces:
org.exolab.core.mipc.DisconnectionEventListener, java.lang.Runnable

public class IpcServerChannel
extends java.lang.Thread
implements org.exolab.core.mipc.DisconnectionEventListener

An instance of this class represents a client's connection to the server. It encapsulates the MultiplexConnection and is responsible for listening to ipc messages and dispatching them to specified NotifierIfc client. This object derives from Thread and runs in its own thread. shutdown() should be used to gracefully stop this thread.

Version:
$Revision: 1.8 $
Author:
Art Whitten
See Also:
MultiplexConnection

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
IpcServerChannel(org.exolab.core.mipc.MultiplexConnectionIfc connection, org.exolab.core.ipc.NotifierIfc client, java.lang.String channel)
          Creates new IpcServerChannel on the specified connection.
 
Method Summary
 void disconnected(org.exolab.core.mipc.MultiplexConnectionIfc connection)
           
 org.exolab.core.mipc.MultiplexConnectionIfc getConnection()
          Return the underlying MultiplexConnection
static IpcServerChannel getServerChannel(java.lang.String id)
          Given a IpcServerChannel uniqueID string, return the associated instance.
 void run()
          This method is called when the thread starts.
 void shutdown()
          Stop execution of this thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IpcServerChannel

public IpcServerChannel(org.exolab.core.mipc.MultiplexConnectionIfc connection,
                        org.exolab.core.ipc.NotifierIfc client,
                        java.lang.String channel)
Creates new IpcServerChannel on the specified connection.
Parameters:
connection - The MultiplexConnection to listen for ipc commands on.
client - This object gets notified of all ipc messages.
channel - The name of the channel to listen on.
Method Detail

getConnection

public org.exolab.core.mipc.MultiplexConnectionIfc getConnection()
Return the underlying MultiplexConnection
Returns:
the underlying connection

run

public void run()
This method is called when the thread starts. It sits in a loop receiving ipc messages. When a message is received, it is passed onto the client notifier.
Overrides:
run in class java.lang.Thread

shutdown

public void shutdown()
Stop execution of this thread.

disconnected

public void disconnected(org.exolab.core.mipc.MultiplexConnectionIfc connection)
Specified by:
disconnected in interface org.exolab.core.mipc.DisconnectionEventListener

getServerChannel

public static IpcServerChannel getServerChannel(java.lang.String id)
Given a IpcServerChannel uniqueID string, return the associated instance.
Parameters:
id - The string ID of the IpcServerChannel we are looking for.
Returns:
IpcServerChannel The found object, null if none.


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.