com.bea.wli.sb.transports
Class TransportManagerHelper

java.lang.Object
  extended by com.bea.wli.sb.transports.TransportManagerHelper

public class TransportManagerHelper
extends Object

Helper class that allows the client to execute some common tasks with respect to Transport subsystem


Method Summary
static boolean clusterExists()
           
static Set<String> getDispatchPolicies()
           
static GenericDataEntry getGenericDataEntry(Ref ref)
           
static ServiceInfo getServiceInfo(Ref ref)
           
static TransportManager getTransportManager()
           
static weblogic.security.UsernameAndPassword getUsernamePasswordCredential(TransportProvider provider, Ref serviceAccount)
           
static boolean isAdmin()
           
static void schedule(Runnable runnable, String dispatchPolicy)
          Schedule a work instance for execution in another thread associated with specified dispatch policy.
static List<Ref> searchInstanceIds(String typeId, String keyName, Object keyValue)
          Returns a list of references for instances that has the given keyValue for the given key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTransportManager

public static TransportManager getTransportManager()
                                            throws TransportException
Returns:
Returns an instance of Transport Manager.
Throws:
TransportException

isAdmin

public static boolean isAdmin()
Returns:
Returns whether or not the code is being executed on the admin server

clusterExists

public static boolean clusterExists()
Returns:
true if ALSB is deployed in a WLS clustered domain

getGenericDataEntry

public static GenericDataEntry getGenericDataEntry(Ref ref)
                                            throws TransportException
Parameters:
ref - data entry reference
Returns:
generic data entry (resource) object associated with a given ref. One example of generic data entry is a collection of Java interfaces needed by the EJB transport provider to be able to connect to the remote EJB.
Throws:
TransportException

getUsernamePasswordCredential

public static weblogic.security.UsernameAndPassword getUsernamePasswordCredential(TransportProvider provider,
                                                                                  Ref serviceAccount)
                                                                           throws CredentialNotFoundException
Parameters:
provider - transport provider
serviceAccount - a reference to a service account
Returns:
the username and password assigned to the service account. Transport providers that need access to credentials during activation can use this interface to lookup a username/password assigned to a service account. This interface should not be used to lookup credentials during outbound messaging
Throws:
CredentialNotFoundException - if the service account does not exist or if a username/password has not been assigned to the service account

getServiceInfo

public static ServiceInfo getServiceInfo(Ref ref)
                                  throws TransportException
Parameters:
ref - service reference
Returns:
service information, i.e. binding, transport configuration, etc. for corresponding service
Throws:
TransportException

searchInstanceIds

public static List<Ref> searchInstanceIds(String typeId,
                                          String keyName,
                                          Object keyValue)
                                   throws TransportException
Returns a list of references for instances that has the given keyValue for the given key. Can be used by transport providers to search for all services that match a certain search criteria.

Parameters:
keyName - can be one of the defined type ids, e.g. TypeIds.PROXY_REF. Also see TypeIds
keyValue - can be one of the defined queries, e.g. ProxyServiceQuery.KEY_PROXYURI. Also see ProxyServiceQuery and BusinessServiceQuery
Returns:
a list of references for instances that has the given keyValue for the given key. Returns empty list if none found.
Throws:
TransportException

schedule

public static void schedule(Runnable runnable,
                            String dispatchPolicy)
                     throws TransportException
Schedule a work instance for execution in another thread associated with specified dispatch policy. This method can be used by transport providers to post the results of outbound blocking message call back to ALSB response pipeline on a different thread than that on which the incoming request method was received. Dispatch policies can be configured with WLS console by the way of registering new Work Managers in the domain. If dispatchPolicy argument is null, the default dispatch policy will be used. Other semantics: o Runnable.run() will be called in the context of the security subject, if any, that was present at the time schedule() was invoked.

Parameters:
runnable - action to execute asynchronously
dispatchPolicy - name of the WLS WorkManager which will be used to execute the Runnable.run action. Maybe null, in which case the default work manager will be used.
Throws:
TransportException

getDispatchPolicies

public static Set<String> getDispatchPolicies()
                                       throws TransportException
Returns:
list of all available dispatch policies in ALSB domain
Throws:
TransportException