wt.method
Class WTAdapterImpl

java.lang.Object
  extended bywt.method.WTAdapterImpl
All Implemented Interfaces:
IeCertificateRetriever, IeMultithreadedProcessor, IeProcessor, PropertyListener

public class WTAdapterImpl
extends Object
implements IeMultithreadedProcessor, IeCertificateRetriever, PropertyListener


Nested Class Summary
private  class WTAdapterImpl.ContextManager
          Inner class that keeps MethodContext instances alive between webjects.
 
Field Summary
private static String DEFAULT_USER
           
private static String DELEGATE_FACTORY
           
private static String DELEGATE_TYPE
           
private static Method factoryMethod
           
private static Boolean initialized
           
private static WTAdapterImpl instance
          Check the state of the current method context to determine whether a session is associated with it.
private static Method invokeMethod
           
static String LOCALE_KEY
           
private static int MAX_SESSION_IDLE
           
private static String RESOURCE
           
static String SESSION_CONTAINER_KEY
           
static String SESSION_TRANSACTION_KEY
           
static String SESSION_USER_KEY
           
private static boolean VERBOSE
           
private static boolean VERBOSE_EXCEPTION
           
private static boolean VERBOSE_SESSION
           
private static boolean VERBOSE_WEBJECT
           
 
Constructor Summary
WTAdapterImpl()
           
 
Method Summary
static void checkSession(MethodContext context)
           
private  String getUser(Webject webject, Task task)
          Returns a verified username, if any, from a specified webject and/or task object.
 void initialize(String serviceName, com.infoengine.log.LogWriter log)
          Initialize the adapter implementation class.
 void initialize(String serviceName, Properties properties, com.infoengine.log.LogWriter log)
           
private  WTAdapterImpl.ContextManager newContextManager(MethodContext context)
           
 IeRequest processRequest(Request request)
          Process a request to execute a webject or a task.
private  IeRequest processTask(Task task)
          Process a request to execute a task.
private  IeRequest processWebject(Task task, Webject webject)
          Process a request to execute a webject.
 void refreshProperties()
          Refresh static System properties after a dynamic property update.
 Certificate retrieveCertificate(String owner)
          Returns the certificate for a principal specified by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

DELEGATE_FACTORY

private static final String DELEGATE_FACTORY
See Also:
Constant Field Values

DELEGATE_TYPE

private static final String DELEGATE_TYPE
See Also:
Constant Field Values

LOCALE_KEY

public static final String LOCALE_KEY
See Also:
Constant Field Values

SESSION_CONTAINER_KEY

public static final String SESSION_CONTAINER_KEY
See Also:
Constant Field Values

SESSION_USER_KEY

public static final String SESSION_USER_KEY
See Also:
Constant Field Values

SESSION_TRANSACTION_KEY

public static final String SESSION_TRANSACTION_KEY
See Also:
Constant Field Values

MAX_SESSION_IDLE

private static int MAX_SESSION_IDLE

VERBOSE

private static boolean VERBOSE

VERBOSE_EXCEPTION

private static boolean VERBOSE_EXCEPTION

VERBOSE_SESSION

private static boolean VERBOSE_SESSION

VERBOSE_WEBJECT

private static boolean VERBOSE_WEBJECT

DEFAULT_USER

private static String DEFAULT_USER

factoryMethod

private static Method factoryMethod

invokeMethod

private static Method invokeMethod

initialized

private static Boolean initialized

instance

private static WTAdapterImpl instance
Check the state of the current method context to determine whether a session is associated with it. If a session is associated, assign the context to a context manager thread to ensure that it is not unregistered prematurely. If the context is not associated with a session, unregister it.

Constructor Detail

WTAdapterImpl

public WTAdapterImpl()
Method Detail

initialize

public void initialize(String serviceName,
                       com.infoengine.log.LogWriter log)
Description copied from interface: IeProcessor
Initialize the adapter implementation class.

Specified by:
initialize in interface IeProcessor
Parameters:
serviceName - Logical name defined for this implementation
log - file to write informational and debug messages.

initialize

public void initialize(String serviceName,
                       Properties properties,
                       com.infoengine.log.LogWriter log)

refreshProperties

public void refreshProperties()
Refresh static System properties after a dynamic property update.

Specified by:
refreshProperties in interface PropertyListener

processRequest

public IeRequest processRequest(Request request)
                         throws IEException
Process a request to execute a webject or a task.

Specified by:
processRequest in interface IeProcessor
Parameters:
request - The request object that conveys the webject or task to be executed.
Returns:
The response.
Throws:
IEException - if the request is not executed successfully.

checkSession

public static void checkSession(MethodContext context)

newContextManager

private WTAdapterImpl.ContextManager newContextManager(MethodContext context)

processTask

private IeRequest processTask(Task task)
                       throws Exception
Process a request to execute a task.

Parameters:
task - The task object that contains the URI of the task to be executed and the input groups associated with it.
Returns:
The task response object.
Throws:
IEException - if anything goes wrong.
Exception

processWebject

private IeRequest processWebject(Task task,
                                 Webject webject)
                          throws Exception
Process a request to execute a webject.

Parameters:
task - The task object that contains the webject to be executed and the input groups associated with it.
webject - The webject itself.
Returns:
The webject response object.
Throws:
IEException - if anything goes wrong.
Exception

retrieveCertificate

public Certificate retrieveCertificate(String owner)
                                throws IEException
Returns the certificate for a principal specified by name.

Specified by:
retrieveCertificate in interface IeCertificateRetriever
Parameters:
owner - The name of the principal.
Returns:
The principal's certificate, or null if the principal does not have a certificate.
Throws:
SocketAccessException - if the certificate can not be retrieved successfully.
IEException - if the certificate can not be retrieved.

getUser

private String getUser(Webject webject,
                       Task task)
                throws WTException
Returns a verified username, if any, from a specified webject and/or task object.

Parameters:
webject - Webject possibly containing authentication info
task - Task possibly containing signed auth-user info
Returns:
A verified username, or null if no username verified.
Throws:
WTException