xmlBlaster 2.2.0 contributions API

org.xmlBlaster.contrib.socketgetter
Class SocketGetter

java.lang.Object
  extended by java.lang.Thread
      extended by org.xmlBlaster.contrib.socketgetter.SocketGetter
All Implemented Interfaces:
java.lang.Runnable

public class SocketGetter
extends java.lang.Thread

SocketGetter launches a xmlBlaster-client which listens on the given socket and delivers the content of the oid given in a telnet session.

Usage:
java org.xmlBlaster.contrib.socketgetter.SocketGetter -port <port>

Example for usage:
java org.xmlBlaster.contrib.socketgetter.SocketGetter -port 9876 -plugin/socket/hostname server
(sleep 1; echo "get __sys__UserList"; sleep 1) | telnet localhost 9876
The host which the telnet connects to is the one which runns the SocketGetter. This host may differ from the one running the xmlBaslter server, of course.
In this example, the xmlBlaster runns on the host called server, where at the SocketGetter runns on the localhost on port 9876.

This class may be configured as a native plugin as well, see SocketGetterPlugin.

Author:
Heinrich Götzger

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SocketGetter(org.xmlBlaster.util.Global global)
          Convenience constructor dor the use from the main method.
SocketGetter(org.xmlBlaster.util.Global global, int port)
          Starts the SocketGetter.
 
Method Summary
static void main(java.lang.String[] args)
          The main method.
 void run()
          Starts the socket getter task.
 void shutdown()
          Closes the connectionto xmlBlaster server.
 
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
 

Constructor Detail

SocketGetter

public SocketGetter(org.xmlBlaster.util.Global global,
                    int port)
Starts the SocketGetter. The args must contain a valid port.
This instance opens one connection to the xmlBlaster-server and starts a socket server on the given port. Once a client has been accepted by the server, a new thread will be startet for this client. A new client may connect to the listening socket immediately afterwards.
The socket-thread answers one get request and closes the connection right after the request has been answered.
The request must start with get otherwise no message will be delivered.

java.util.logging.Level.FINER is good for debugging purposes.

Parameters:
global - The Global instance created in main.
port - The port where the socket listens on.

SocketGetter

public SocketGetter(org.xmlBlaster.util.Global global)
Convenience constructor dor the use from the main method.

Parameters:
global - The Global instance created in main.
Method Detail

run

public void run()
Starts the socket getter task.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

shutdown

public void shutdown()
Closes the connectionto xmlBlaster server.


main

public static void main(java.lang.String[] args)
The main method.

Parameters:
args - The command-line arguments.

xmlBlaster 2.2.0 contributions API

Copyright © 1999-2014 The xmlBlaster.org contributers.