org.planx.xmlstore.stores
Class NetworkSkeleton

java.lang.Object
  extended by org.planx.xmlstore.stores.NetworkSkeleton

public class NetworkSkeleton
extends Object

A NetworkSkeleton exposes the functionality of an underlying XMLStore to networked clients. Once created, the Stub handles requests on the specified port from clients.

For now the Stub only understands LOAD and SAVE requests. A LOAD request includes a value reference which is then loaded from the underlying XMLStore. The resulting Node is marshalled and sent in a response to the client.

A SAVE request includes either character data, or element data in the form of a tag and a list of child value references. A Node is created based on this and then saved in the underlying XMLStore. The resulting value reference is sent back to the client.

NetworkSkeleton is not quite a decorator as it does not implement the XML Store. It is not quite an Adaptor either, as it does not implement any interface.

Author:
Henning Niss

Constructor Summary
NetworkSkeleton(XMLStore xmlstore, int port)
          Create a Network Stub XML Store which listens on the specified port and handles requests using the specified underlying XML Store.
 
Method Summary
 void close()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkSkeleton

public NetworkSkeleton(XMLStore xmlstore,
                       int port)
Create a Network Stub XML Store which listens on the specified port and handles requests using the specified underlying XML Store. The store will create a default number of threads to handle requests (currently 100).

Parameters:
xmlstore - the underlying XML Store
port - the port on which to listen
Method Detail

close

public void close()
           throws IOException
Throws:
IOException


Copyright © 2010. All Rights Reserved.