|
jSyncManager Simple Java Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.jSyncManager.SJS.API.AbstractAdapter
public abstract class AbstractAdapter
The Abstract Adapter class. This class is the parent class of all Adapter classes. It provides the basic I/O and data mechanisms.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected java.util.Properties |
props
The properties held by the connection manager instance. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AbstractAdapter()
Constructs a new instance of this abstract adapter. |
Method Summary | |
---|---|
protected boolean |
connectionPermitted(java.net.InetAddress address)
A method for testing wether or not the connection should be permitted. |
protected void |
disconnect()
Process any disconnection details. |
protected ConnectionManagerInterface |
getConnectionManagerInterface()
Retrieves a handle to the configuration manager interface object. |
protected java.net.InetAddress |
getInetAddress()
Retrieves the internet address object for the connected host. |
protected LogManager |
getLogManager()
Retrieves a handle to the current log manager. |
protected java.lang.String |
getProperty(java.lang.String name)
Gets the specified property from the properties object passed from the Connection Manager. |
protected abstract void |
processConnection(java.io.InputStream in,
java.io.OutputStream out)
The processConnection method. |
void |
processConnection(java.net.Socket socket,
java.util.Properties props,
ConnectionManagerInterface cm)
The processConnection method. |
void |
run()
Runs the logic for this adapter in a seperate thread. |
void |
setLogManager(LogManager log)
Set the log manager to use for loging messages. |
static void |
setThreadGroup(java.lang.ThreadGroup group)
Statically set the thread group all new instances should be created in. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 |
Field Detail |
---|
protected java.util.Properties props
Constructor Detail |
---|
public AbstractAdapter()
Method Detail |
---|
protected abstract void processConnection(java.io.InputStream in, java.io.OutputStream out) throws java.lang.Exception
in
- the InputStream object for communications.out
- the OutputStream object for communications.
java.lang.Exception
- any checked exception not caught and handled by the
adapter.public void processConnection(java.net.Socket socket, java.util.Properties props, ConnectionManagerInterface cm)
socket
- the Socket for the connection.props
- the Properties object for this adapter instance.cm
- the ConnectionManagerInterface to use for connection manager
message passing.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Thread
protected java.lang.String getProperty(java.lang.String name)
name
- the name of the property to retrieve.
protected boolean connectionPermitted(java.net.InetAddress address)
address
- the InetAddress object associated with this connection.
public static void setThreadGroup(java.lang.ThreadGroup group)
group
- the ThreadGroup to use for all instances of this class.public void setLogManager(LogManager log)
log
- the log manaer to use.protected LogManager getLogManager()
protected ConnectionManagerInterface getConnectionManagerInterface()
protected void disconnect()
protected java.net.InetAddress getInetAddress()
|
jSyncManager Simple Java Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |