- java.lang.Object
-
- javax.jnlp.ServiceManager
-
public final class ServiceManager extends Object
TheServiceManager
provides static methods to lookup JNLP services. This class is final and cannot be instantiated.Requests are delegated to a
ServiceManagerStub
object. This object must be set by the JNLP Client on startup using thesetServiceManagerStub
method.- Since:
- 1.4.2
- See Also:
ServiceManagerStub
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]
getServiceNames()
Returns the names of all services implemented by the JNLP Client.static Object
lookup(String name)
Asks the JNLP Client for a service with a given name.static void
setServiceManagerStub(ServiceManagerStub stub)
Sets the object that alllookup
andgetServiceNames
requests are delegated to.
-
-
-
Method Detail
-
lookup
public static Object lookup(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
- the 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 ifname
is null.
-
getServiceNames
public static String[] getServiceNames()
Returns the names of all services implemented by the JNLP Client.- Returns:
- the names of all services implemented by the JNLP Client
-
setServiceManagerStub
public static void setServiceManagerStub(ServiceManagerStub stub)
Sets the object that alllookup
andgetServiceNames
requests are delegated to. ThesetServiceManagerStub
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
-
-