com.vinculumtech.carrierwave.session
Class ClientSession

java.lang.Object
  extended bycom.vinculumtech.carrierwave.session.ClientSession
Direct Known Subclasses:
EJBClientSession, LocalClientSession, RMIClientSession

public abstract class ClientSession
extends java.lang.Object

ClientSession is the root class for all CarrierWave interactions. Create a new session by invoking createClientSession().

The properties parameter is passed to the concrete implementation of ClientSession. For the EJBClientSession, JNDI connection and authentication properties can be passed.

The properties parameter is also checked for the ClientSession class name to instantiate. This allows a single client to use an EJB, RMI, JMS, or local ClientSession interface.

Use the resulting instance of ClientSession to connect or disconnect from the remote server. Or to get references to QueryClient, or RepositoryClient.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/session/ClientSession.java#13 $

Field Summary
static java.lang.String CLIENT_SESSION
           
static java.lang.String CLIENT_SESSION_DEFAULT
           
 
Constructor Summary
ClientSession()
           
 
Method Summary
 void connect()
          Creates a connection to the remote server
protected abstract  CommonClient connectCommonClient()
           
static ClientSession createClientSession(java.util.Properties properties)
          A factory method to return instances of ClientSession for the given set of properties.
Note the returned instance is not a singleton, a new instance is returned on every call allowing for multiple sessions in a single process against any server specified in the Properties parameter.
The Properties excpected on the EJBClientSession are standard JNDI context values.
protected abstract  void destroyCommonClient(CommonClient commonClient)
           
 void disconnect()
          Destroys a connection to the remote server
protected  CommonClient getCommonClient()
           
 java.util.Properties getProperties()
           
 java.lang.String getProperty(java.lang.String property, java.lang.String defaultValue)
           
 QueryClient getQueryClient()
           
 RepositoryClient getRepositoryClient()
           
 void handleGraphException(GraphException exception)
           
 void handleGraphPlanException(GraphPlanException exception)
           
 void handleRemoteException(java.rmi.RemoteException exception)
           
 void handleUndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException exception)
           
 void handleUnknownException(java.lang.Exception exception)
           
 boolean isAutoConnect()
           
 boolean isConnected()
          Returns true iff a connection has already been established.
 void setAutoConnect(boolean isAutoConnect)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_SESSION

public static final java.lang.String CLIENT_SESSION
See Also:
Constant Field Values

CLIENT_SESSION_DEFAULT

public static final java.lang.String CLIENT_SESSION_DEFAULT
See Also:
Constant Field Values
Constructor Detail

ClientSession

public ClientSession()
Method Detail

createClientSession

public static ClientSession createClientSession(java.util.Properties properties)
A factory method to return instances of ClientSession for the given set of properties.
Note the returned instance is not a singleton, a new instance is returned on every call allowing for multiple sessions in a single process against any server specified in the Properties parameter.
The Properties excpected on the EJBClientSession are standard JNDI context values. For example:
Context.INITIAL_CONTEXT_FACTORY // default is ClientSession.DEFAULT_INITIAL_CONTEXT_FACTORY Context.SECURITY_PRINCIPAL Context.SECURITY_CREDENTIALS Context.PROVIDER_URL


getProperties

public java.util.Properties getProperties()

getProperty

public java.lang.String getProperty(java.lang.String property,
                                    java.lang.String defaultValue)

getCommonClient

protected CommonClient getCommonClient()
                                throws ClientSessionException
Throws:
ClientSessionException

getQueryClient

public QueryClient getQueryClient()

getRepositoryClient

public RepositoryClient getRepositoryClient()

isConnected

public boolean isConnected()
Returns true iff a connection has already been established.


connect

public void connect()
             throws ClientSessionException
Creates a connection to the remote server

Throws:
ClientSessionException

disconnect

public void disconnect()
                throws ClientSessionException
Destroys a connection to the remote server

Throws:
ClientSessionException

isAutoConnect

public boolean isAutoConnect()

setAutoConnect

public void setAutoConnect(boolean isAutoConnect)

connectCommonClient

protected abstract CommonClient connectCommonClient()
                                             throws SessionFailureException
Throws:
SessionFailureException

destroyCommonClient

protected abstract void destroyCommonClient(CommonClient commonClient)
                                     throws SessionFailureException
Throws:
SessionFailureException

handleUndeclaredThrowableException

public void handleUndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException exception)
                                        throws SessionFailureException
Throws:
SessionFailureException

handleRemoteException

public void handleRemoteException(java.rmi.RemoteException exception)
                           throws SessionFailureException
Throws:
SessionFailureException

handleGraphException

public void handleGraphException(GraphException exception)
                          throws GraphException
Throws:
GraphException

handleGraphPlanException

public void handleGraphPlanException(GraphPlanException exception)
                              throws GraphPlanException
Throws:
GraphPlanException

handleUnknownException

public void handleUnknownException(java.lang.Exception exception)
                            throws SessionFailureException
Throws:
SessionFailureException


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.