public class ExtrasUtilities extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HK2BRIDGE_LOCATOR_ID
This will be put into the metadata of a descriptor that is bridged from another service locator.
|
static String |
HK2BRIDGE_SERVICE_ID
This will be put into the metadata of a descriptor that is bridged from another service locator.
|
Constructor and Description |
---|
ExtrasUtilities() |
Modifier and Type | Method and Description |
---|---|
static void |
bridgeServiceLocator(ServiceLocator into,
ServiceLocator from)
This method will bridge all non-local services from the
from ServiceLocator into the into ServiceLocator.
|
static void |
enableDefaultInterceptorServiceImplementation(ServiceLocator locator)
This method adds in a default implementation of the
InterceptionService
which uses annotations to denote which services should intercept other services. |
static void |
enableOperations(ServiceLocator locator)
This method adds in the infrastructure necessary to enable HK2 Operations support.
|
static void |
enableTopicDistribution(ServiceLocator locator)
This method will enable the default topic distribution service.
|
static void |
unbridgeServiceLocator(ServiceLocator into,
ServiceLocator from)
This method will remove all non-local services from the
from ServiceLocator into the into ServiceLocator.
|
public static final String HK2BRIDGE_LOCATOR_ID
public static final String HK2BRIDGE_SERVICE_ID
public static void enableDefaultInterceptorServiceImplementation(ServiceLocator locator)
InterceptionService
which uses annotations to denote which services should intercept other services. For more
information see the org.glassfish.hk2.extras.interception package. This method is
idempotent, if the service is already available it will not add itlocator
- The locator to add the default interception service implementation to. May not be nullpublic static void enableOperations(ServiceLocator locator)
OperationManager
.
This method is idempotent, if the service is already available it will not add itlocator
- The locator to add the infrastructure needed to use the HK2
Operations supportpublic static void bridgeServiceLocator(ServiceLocator into, ServiceLocator from)
into
- The non-null ServiceLocator that will have services added
to it from the from ServiceLocatorfrom
- The non-null ServiceLocator that will add services to the
into ServiceLocatorpublic static void unbridgeServiceLocator(ServiceLocator into, ServiceLocator from)
into
- The non-null ServiceLocator that will have services added
to it from the from ServiceLocatorfrom
- The non-null ServiceLocator that will add services to the
into ServiceLocatorpublic static void enableTopicDistribution(ServiceLocator locator)
The default distribution service distributes messages on the
same thread as the caller of Topic.publish(Object)
.
Objects to be distributed to will be
held with SoftReferences, and hence if they go out of scope they
will not be distributed to. Only services created AFTER the topic
distribution service is enabled will be distributed to.
This method is idempotent, so that if there is already a TopicDistributionService with the default name is available this method will do nothing
locator
- The service locator to enable topic distribution on. May not be nullCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.