Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.api
Class JndiServiceLocator

java.lang.Object
  extended by org.nuxeo.runtime.api.JndiServiceLocator
All Implemented Interfaces:
Serializable, ServiceLocator
Direct Known Subclasses:
JBossServiceLocator

public class JndiServiceLocator
extends Object
implements ServiceLocator

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Constructor Summary
JndiServiceLocator()
           
 
Method Summary
 void dispose()
          Disposes this locator.
 InitialContext getContext()
           
 void initialize(String host, int port, Properties properties)
          Initializes and creates the JNDI initial context.
 Object lookup(ServiceDescriptor sd)
          Lookup the service described by the given service descriptor.
 Object lookup(String serviceId)
          Lookup the service given its ID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiServiceLocator

public JndiServiceLocator()
Method Detail

initialize

public void initialize(String host,
                       int port,
                       Properties properties)
                throws Exception
Initializes and creates the JNDI initial context.

Specified by:
initialize in interface ServiceLocator
Parameters:
host - the host where the lookup will be done. The host is optional and may be null if the services are looked up in the current JVM
port - the port of the host to be used to lookup.
properties - the properties are implementation dependent Properties may be null if no properties are required. The port is meaningful only if the host was specified
Throws:
Exception

dispose

public void dispose()
Description copied from interface: ServiceLocator
Disposes this locator. Free any allocated resources.

Specified by:
dispose in interface ServiceLocator

getContext

public InitialContext getContext()

lookup

public Object lookup(ServiceDescriptor sd)
              throws Exception
Description copied from interface: ServiceLocator
Lookup the service described by the given service descriptor.

Specified by:
lookup in interface ServiceLocator
Parameters:
sd - the service descriptor
Returns:
the service instance or null if no such service was found
Throws:
Exception - if any error occurs

lookup

public Object lookup(String serviceId)
              throws Exception
Description copied from interface: ServiceLocator
Lookup the service given its ID.

Specified by:
lookup in interface ServiceLocator
Parameters:
serviceId - the service ID
Returns:
the service instance or null if no such service was found
Throws:
Exception - if any error occurs

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.