public class ExtrasUtilities
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BRIDGE_NAME_POSTFIX |
private static java.lang.String |
BRIDGE_NAME_PREFIX |
private static java.lang.String |
COMMA |
static java.lang.String |
HK2BRIDGE_LOCATOR_ID
This will be put into the metadata of a descriptor that is bridged from another service locator.
|
static java.lang.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.
|
private static void |
checkParentage(ServiceLocator a,
ServiceLocator b) |
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.
|
private static java.lang.String |
getBridgeName(ServiceLocator into,
ServiceLocator from) |
private static boolean |
isDupException(MultiException me) |
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 java.lang.String HK2BRIDGE_LOCATOR_ID
public static final java.lang.String HK2BRIDGE_SERVICE_ID
private static final java.lang.String BRIDGE_NAME_PREFIX
private static final java.lang.String COMMA
private static final java.lang.String BRIDGE_NAME_POSTFIX
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 supportprivate static java.lang.String getBridgeName(ServiceLocator into, ServiceLocator from)
private static void checkParentage(ServiceLocator a, ServiceLocator b)
public 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)
and (TBD security policy). 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 nullprivate static boolean isDupException(MultiException me)