org.alembik
Class EJBServiceLocator

java.lang.Object
  extended by org.alembik.EJBServiceLocator
All Implemented Interfaces:
TranscodingServiceLocator

public class EJBServiceLocator
extends java.lang.Object
implements TranscodingServiceLocator

The locator, which yields a reconnectable EJB stub to the transcoding service.

Since:
1.0-beta1

Field Summary
static java.lang.String EJB_LOCAL_PARAM
          The parameter, whose true value forces looking up the local EJB interface (for server-side use only).
static java.lang.String EJB_PARAM_PREFIX
          The prefix identifying JNDI properties to be passed to InitialContext used to look up the transcoding service.
 
Constructor Summary
EJBServiceLocator()
           
 
Method Summary
 TranscodingService getService(java.util.Properties config)
          Returns the remote or local EJB service looked up with the given JNDI properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EJB_PARAM_PREFIX

public static final java.lang.String EJB_PARAM_PREFIX
The prefix identifying JNDI properties to be passed to InitialContext used to look up the transcoding service.

See Also:
Constant Field Values

EJB_LOCAL_PARAM

public static final java.lang.String EJB_LOCAL_PARAM
The parameter, whose true value forces looking up the local EJB interface (for server-side use only).

See Also:
Constant Field Values
Constructor Detail

EJBServiceLocator

public EJBServiceLocator()
Method Detail

getService

public TranscodingService getService(java.util.Properties config)
                              throws javax.naming.ServiceUnavailableException

Returns the remote or local EJB service looked up with the given JNDI properties. Actually only the properties prefixed with ejb. will be taken into account (with the prefix removed).

If EJB_LOCAL_PARAM is present and set to true the local EJB service will be retrieved. Otherwise the method looks up the remote EJB service and wraps it with a proxy, which attempts to reconnect the transcoding server is case of a connection breakdown (tested on Glassfish v2 & JBoss 4.2.X).

Specified by:
getService in interface TranscodingServiceLocator
Parameters:
config - JNDI and configuration properties
Returns:
service's EJB stub
Throws:
javax.naming.ServiceUnavailableException - if the service cannot be contacted
See Also:
EJB_PARAM_PREFIX, EJB_LOCAL_PARAM