Package | Class | Tree | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.jnlp
Class ServiceManager

    java.lang.Object
      javax.jnlp.ServiceManager

    public final class ServiceManager

extends java.lang.Object

The `ServiceManager` provides static methods to lookup JNLP services. This class is abstract and final and cannot be instantiated.

Requests are delegated to a `ServiceManagerStub` object. This object must be set by the JNLP Client on startup using the `setServiceManagerStub` method.

Since:
  1.0
See Also:
  `ServiceManagerStub`

Method Summary
`static java.lang.String[]` | `getServiceNames()` Returns the names of all services implemented by the JNLP Client.
`static java.lang.Object` | `lookup(java.lang.String name)` Asks the JNLP Client for a service with a given name.
`static void` | `setServiceManagerStub(ServiceManagerStub stub)` Sets the object that all `lookup` and `getServiceNames` requests are delegated to.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### lookup

    public static java.lang.Object lookup(java.lang.String name)
                                   throws UnavailableServiceException

  Asks the JNLP Client for a service with a given name. The lookup must be idempotent, that is return the same object for each invocation with the same name.

  Parameters:
    `name` - Name of service to lookup.
  Returns:
    An object implementing the service. `null` will never be returned. Instead an exception will be thrown.
  Throws:
    ``UnavailableServiceException`` - if the service is not available, or if `name` is null.
    `UnavailableServiceException`

### getServiceNames

    public static java.lang.String[] getServiceNames()

  Returns the names of all services implemented by the JNLP Client.

### setServiceManagerStub

    public static void setServiceManagerStub(ServiceManagerStub stub)

  Sets the object that all `lookup` and `getServiceNames` requests are delegated to. The `setServiceManagerStub` call is ignored if the stub has already been set.

  This method should be called exactly once by the JNLP Client, and never be called by a launched application.

  Parameters:
    `stub` - The ServiceManagerStub object to delegate to

Package | Class | Tree | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved