org.marketcetera.util.ws.stateless
Class StatelessClient

java.lang.Object
  extended by org.marketcetera.util.ws.stateless.Node
      extended by org.marketcetera.util.ws.stateless.StatelessClient
Direct Known Subclasses:
Client

public class StatelessClient
extends Node

A client node for stateless communication. Its (optional) application ID is that of the application which hosts the client.

Since:
1.0.0
Version:
$Id: StatelessClient.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Field Summary
 
Fields inherited from class org.marketcetera.util.ws.stateless.Node
DEFAULT_HOST, DEFAULT_PORT
 
Constructor Summary
StatelessClient()
          Creates a new client node with the default server host name and port, and no client application ID.
StatelessClient(AppId appId)
          Creates a new client node with the default server host name and port, and the given client application ID.
StatelessClient(String host, int port, AppId appId)
          Creates a new client node with the given server host name, port, and client application ID.
StatelessClient(String inHost, int inPort, AppId inAppId, Class<?>... inContextClasses)
          Create a new StatelessClient instance.
 
Method Summary
protected  void fillContext(StatelessClientContext context)
          Sets the properties of the given client context, so that it may be used for remote calls made via proxies obtained from the receiver.
 AppId getAppId()
          Returns the receiver's application ID.
 StatelessClientContext getContext()
          Returns a client context which the client must supply as an argument to every remote call made via proxies obtained from the receiver.
<T extends StatelessServiceBase>
T
getService(Class<T> iface)
          Retrieves the client-side proxy for the given service interface.
 
Methods inherited from class org.marketcetera.util.ws.stateless.Node
getConnectionUrl, getHost, getId, getPort, setHost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatelessClient

public StatelessClient(String inHost,
                       int inPort,
                       AppId inAppId,
                       Class<?>... inContextClasses)
Create a new StatelessClient instance.

Parameters:
inHost - a String value
inPort - an int value
inAppId - an AppId value
inContextClasses - a Class<?>... value

StatelessClient

public StatelessClient(String host,
                       int port,
                       AppId appId)
Creates a new client node with the given server host name, port, and client application ID.

Parameters:
host - The host name.
port - The port.
appId - The application ID, which may be null.

StatelessClient

public StatelessClient(AppId appId)
Creates a new client node with the default server host name and port, and the given client application ID.

Parameters:
appId - The application ID, which may be null.

StatelessClient

public StatelessClient()
Creates a new client node with the default server host name and port, and no client application ID.

Method Detail

getAppId

public AppId getAppId()
Returns the receiver's application ID.

Returns:
The application ID, which may be null.

fillContext

protected void fillContext(StatelessClientContext context)
Sets the properties of the given client context, so that it may be used for remote calls made via proxies obtained from the receiver.

Parameters:
context - The context.

getContext

public StatelessClientContext getContext()
Returns a client context which the client must supply as an argument to every remote call made via proxies obtained from the receiver.

Returns:
The context.

getService

public <T extends StatelessServiceBase> T getService(Class<T> iface)
Retrieves the client-side proxy for the given service interface.

Parameters:
iface - The interface class.


Copyright © 2012. All Rights Reserved.