com.sibvisions.rad.server.object
Class ExchangeSession

java.lang.Object
  extended by com.sibvisions.rad.server.object.ExchangeSession

public class ExchangeSession
extends Object

The ExchangeSession is a session bound connection. It can be used to direct call methods and actions from the bound server-side session.
The ExchangeSession can be used for accessing the session from outside the server, e.g. a servlet. Example for servlet usage:

server-side action:

 public void Object generateKey()
 {
   return ObjectCache.put(new ExchangeSession());
 }
 
servlet code:
 public void doGet(HttpServletRequest pRequest, HttpServletResponse pResponse) throws ServletException
 {
   ObjectCache.get(pRequest.getParameter("KEY"));
 }
 


Constructor Summary
ExchangeSession()
          Creates a new instance of ExchangeSession.
 
Method Summary
 Object call(String pObjectName, String pMethod)
          The method will call a method from the bound session.
 Object call(String pObjectName, String pMethod, Object... pParams)
          The method will call a method from the bound session.
 Object callAction(String pAction)
          The method will call an action from the bound session.
 Object callAction(String pAction, Object... pParams)
          The method will call an action from the bound session.
 Object getProperty(String pName)
          Gets the value of a session property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExchangeSession

public ExchangeSession()
Creates a new instance of ExchangeSession. The instance will be bound to a server-side session. All method and action calls will be made through the bound session.

Method Detail

call

public Object call(String pObjectName,
                   String pMethod,
                   Object... pParams)
            throws Throwable
The method will call a method from the bound session.

Parameters:
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
pParams - parameters for the method call
Returns:
result from the remote method call
Throws:
Throwable - communication error, security checks, invalid method, ...

call

public Object call(String pObjectName,
                   String pMethod)
            throws Throwable
The method will call a method from the bound session.

Parameters:
pObjectName - an already mapped server object name/alias
pMethod - method name which should be called
Returns:
result from the remote method call
Throws:
Throwable - communication error, security checks, invalid method, ...

callAction

public Object callAction(String pAction)
                  throws Throwable
The method will call an action from the bound session.

Parameters:
pAction - action which should be called
Returns:
result from the remote action call
Throws:
Throwable - communication error, security checks, invalid action, ...

callAction

public Object callAction(String pAction,
                         Object... pParams)
                  throws Throwable
The method will call an action from the bound session.

Parameters:
pAction - action which should be called
pParams - parameters for the action call
Returns:
result from the remote action call
Throws:
Throwable - communication error, security checks, invalid method, ...

getProperty

public Object getProperty(String pName)
                   throws Throwable
Gets the value of a session property.

Parameters:
pName - the property name
Returns:
the value of the property or null if the property is not available
Throws:
Throwable - communication error, security checks, invalid method, ...


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.