Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.api
Interface ServiceLocator

All Superinterfaces:
Serializable
All Known Implementing Classes:
JBossServiceLocator, JndiServiceLocator, RuntimeServiceLocator

public interface ServiceLocator
extends Serializable

A service locator is used to locate services given a service ID or descriptor.

Service locators may looks up for services over the net or in the current JVM. How the lookup is done is implementation-dependent.

Author:
Bogdan Stefanescu

Method Summary
 void dispose()
          Disposes this locator.
 void initialize(String host, int port, Properties properties)
          Initializes the service locator.
 Object lookup(ServiceDescriptor descriptor)
          Lookup the service described by the given service descriptor.
 Object lookup(String serviceId)
          Lookup the service given its ID.
 

Method Detail

initialize

void initialize(String host,
                int port,
                Properties properties)
                throws Exception
Initializes the service locator.

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

void dispose()
Disposes this locator. Free any allocated resources.


lookup

Object lookup(ServiceDescriptor descriptor)
              throws Exception
Lookup the service described by the given service descriptor.

Parameters:
descriptor - the service descriptor
Returns:
the service instance or null if no such service was found
Throws:
Exception - if any error occurs

lookup

Object lookup(String serviceId)
              throws Exception
Lookup the service given its ID.

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.