cuba.webservice
Class WebserviceClientContext

java.lang.Object
  extended by cuba.webservice.WebserviceClientContext
All Implemented Interfaces:
ClientContextI, ContextI

public class WebserviceClientContext
extends java.lang.Object
implements ClientContextI

Implementation of CUBA's client context interface providing client-side adapter implementations for all required components. The adapter route all components calls to a server using a webservice interface.

Author:
Thomas Kuhlmann
See Also:
WSTClientAdapter

Nested Class Summary
 
Nested classes/interfaces inherited from interface cuba.ContextI
ContextI.Type
 
Field Summary
protected static java.util.Map clClientClasses
          All sub-classes of WSTClientAdapter.
static java.lang.String PASSWORD_PROPERTY
           
static java.lang.String WS_URL_PROPERTY
           
 
Fields inherited from interface cuba.ClientContextI
CALLER_PROPERTY
 
Constructor Summary
WebserviceClientContext()
           
WebserviceClientContext(java.util.Properties prop)
           
 
Method Summary
 java.lang.Object getComponent(java.lang.String pComponentName)
          Returns the component by its name.
 javax.sql.DataSource getDataSource(java.lang.String arg0)
          Not supported for webservices!!!
 javax.transaction.UserTransaction getTransaction()
          Not supported for webservices!!!
 int getType()
          Returns the type of context, to let the context holder perform operations depending on the environment it is working in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PASSWORD_PROPERTY

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

WS_URL_PROPERTY

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

clClientClasses

protected static java.util.Map clClientClasses
All sub-classes of WSTClientAdapter.

Constructor Detail

WebserviceClientContext

public WebserviceClientContext()

WebserviceClientContext

public WebserviceClientContext(java.util.Properties prop)
Method Detail

getType

public int getType()
Description copied from interface: ContextI
Returns the type of context, to let the context holder perform operations depending on the environment it is working in.

Specified by:
getType in interface ContextI
See Also:
ContextI.getType()

getComponent

public java.lang.Object getComponent(java.lang.String pComponentName)
                              throws ReferenceException,
                                     ConstructionException
Returns the component by its name.

The wanted component is retrieved by comparing the name of all sub-classes of WSTClientAdapter with the given component-name appended by "_WSTClient".

Specified by:
getComponent in interface ContextI
Parameters:
pComponentName - The (symbolic) name of the component to look up
Returns:
A proxy object, implementing the component's interface. The return value must be casted to the required type.
Throws:
ReferenceException - if the provided (symbolic) name cannot be resolved.
ConstructionException - if the container failed to provide the required component
See Also:
ContextI.getComponent(java.lang.String)

getTransaction

public javax.transaction.UserTransaction getTransaction()
                                                 throws javax.transaction.SystemException
Not supported for webservices!!!

Specified by:
getTransaction in interface ContextI
Throws:
javax.transaction.SystemException

getDataSource

public javax.sql.DataSource getDataSource(java.lang.String arg0)
                                   throws ConstructionException,
                                          ReferenceException
Not supported for webservices!!!

Specified by:
getDataSource in interface ContextI
Parameters:
arg0 - The symbolic name of the SQL source to look up
Returns:
A proxy object, providing access to the database.
Throws:
ConstructionException - if the container failed to provide the required SQL database
ReferenceException - if the provided symbolic name cannot be resolved.