|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kuali.rice.core.api.lifecycle.BaseLifecycle
org.kuali.rice.ksb.impl.bus.ServiceBusImpl
public class ServiceBusImpl
| Constructor Summary | |
|---|---|
ServiceBusImpl()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
void |
destroy()
|
protected Set<RemoteService> |
filterByApplicationId(String applicationId,
Set<RemoteService> remoteServices)
|
List<Endpoint> |
getAllEndpoints()
Returns an unmodifiable list of all available and online endpoints of which the service bus is aware, including both local and remote endpoints. |
Endpoint |
getConfiguredEndpoint(ServiceConfiguration serviceConfiguration)
Returns the endpoint matching the given service configuration, if one exists. |
Endpoint |
getEndpoint(QName serviceName)
Returns an available endpoint for the service with the given name. |
Endpoint |
getEndpoint(QName serviceName,
String applicationId)
Returns an available endpoint for the service with the given name which is hosted by the application with the given application id. |
List<Endpoint> |
getEndpoints(QName serviceName)
Returns an unmodifiable list of accessible endpoints that are available to the service bus with the given service name. |
String |
getInstanceId()
Returns the instance ID which identifies this client application to the service bus. |
Endpoint |
getLocalEndpoint(QName serviceName)
Returns the endpoint for the service with the given name that was published by this service bus client. |
Map<QName,Endpoint> |
getLocalEndpoints()
Returns an unmodifiable list of all services that have been published by this service bus client. |
List<Endpoint> |
getRemoteEndpoints(QName serviceName)
Returns an unmodifiable list of remotely accessible endpoints that are available in the service registry with the given service name. |
Object |
getService(QName serviceName)
Returns a proxy to the service with the given name. |
Object |
getService(QName serviceName,
String applicationId)
Returns a proxy to the service with the given name which is hosted by the application with the given application id. |
protected boolean |
isDevMode()
|
protected void |
processLocalServiceDiff(LocalServicesDiff localServicesDiff)
|
protected void |
processRemoteServiceDiff(RemoteServicesDiff remoteServicesDiff)
|
ServiceConfiguration |
publishService(ServiceDefinition serviceDefinition,
boolean synchronize)
Publish a service with the given ServiceDefinition to the service bus. |
List<ServiceConfiguration> |
publishServices(List<ServiceDefinition> serviceDefinitions,
boolean synchronize)
Functions as per ServiceBus.publishService(ServiceDefinition, boolean) but allows for multiple
services to be published to the bus in a single operation. |
protected void |
rebuildLocalServiceEndpointAfterPublishing(ServiceEndpoint publishedService)
|
protected ServiceEndpoint |
rebuildServiceEndpointForUpdate(ServiceEndpoint originalEndpoint,
ServiceInfo registryServiceInfo)
|
boolean |
removeService(QName serviceName,
boolean synchronize)
Removes the service from the service bus and the service registry with the given service name. |
List<Boolean> |
removeServices(List<QName> serviceNames,
boolean synchronize)
Functions as per ServiceBus.removeService(QName, boolean) but allows for multiple services to
be removed from the bus in a single operation. |
void |
setDiffCalculator(ServiceRegistryDiffCalculator diffCalculator)
|
void |
setInstanceId(String instanceId)
|
void |
setScheduledPool(KSBScheduledPool scheduledPool)
|
void |
setServiceExportManager(ServiceExportManager serviceExportManager)
|
void |
setServiceRegistry(ServiceRegistry serviceRegistry)
|
void |
start()
|
protected void |
startSynchronizationThread()
|
protected void |
stopSynchronizationThread()
|
void |
synchronize()
Synchronizes the current client's service bus with the central service registry. |
| Methods inherited from class org.kuali.rice.core.api.lifecycle.BaseLifecycle |
|---|
isStarted, setStarted, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceBusImpl()
| Method Detail |
|---|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanException
public void start()
throws Exception
start in interface Lifecyclestart in class BaseLifecycleExceptionprotected boolean isDevMode()
protected void startSynchronizationThread()
public void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeanExceptionprotected void stopSynchronizationThread()
public String getInstanceId()
ServiceBus
getInstanceId in interface ServiceBuspublic void setInstanceId(String instanceId)
public List<Endpoint> getEndpoints(QName serviceName)
ServiceBus
getEndpoints in interface ServiceBuspublic List<Endpoint> getRemoteEndpoints(QName serviceName)
ServiceBusIf the service bus client has also deployed a service with this name, a remoted endpoint to this service will likely also be included in this list assuming that endpoint has already been synchronized with the registry.
In most cases, it is preferable to use ServiceBus.getEndpoints(QName) instead of this method.
Because it will preferably return a local endpoint reference for a given service endpoint if
one is available.
getRemoteEndpoints in interface ServiceBuspublic Endpoint getLocalEndpoint(QName serviceName)
ServiceBus
getLocalEndpoint in interface ServiceBusserviceName - the name of the service represented by the local endpoint
public Map<QName,Endpoint> getLocalEndpoints()
ServiceBus
getLocalEndpoints in interface ServiceBuspublic List<Endpoint> getAllEndpoints()
ServiceBus
getAllEndpoints in interface ServiceBuspublic Endpoint getEndpoint(QName serviceName)
ServiceBus
Based on the nature of this method, if there is more than one endpoint available for the
given name, multiple invocations of this method with the same service name may return
different Endpoint instances each time.
getEndpoint in interface ServiceBusserviceName - the name of the service for which to locate an available endpoint
public Endpoint getEndpoint(QName serviceName,
String applicationId)
ServiceBusServiceBus.getEndpoint(QName) with the exception that it will only consider endpoints with the
given application id.
Invoking this method with a null or blank value for applicationId is equivalent to
invoking ServiceBus.getEndpoint(QName).
getEndpoint in interface ServiceBusserviceName - the name of the service for which to locate an available endpointapplicationId - the id of the application for which to locate an available endpoint for
the given service name
protected Set<RemoteService> filterByApplicationId(String applicationId,
Set<RemoteService> remoteServices)
public Endpoint getConfiguredEndpoint(ServiceConfiguration serviceConfiguration)
ServiceBus
getConfiguredEndpoint in interface ServiceBusserviceConfiguration - the service configuration by which to lookup up the endpoint
public Object getService(QName serviceName)
ServiceBusThis proxy should additionally be thread-safe.
This method is equivalent to invoking #getEndpoint(QName).getService().
getService in interface ServiceBusserviceName - the name of the service for which to locate an available proxy
public Object getService(QName serviceName,
String applicationId)
ServiceBusServiceBus.getService(QName)
with the exception that it will only consider endpoints with the given application id.
Invoking this method with a null or blank value for applicationId is equivalent to
invoking ServiceBus.getService(QName). This method is also equivalent to invoking
#getEndpoint(QName, String).getService().
getService in interface ServiceBusserviceName - the name of the service for which to locate an available proxyapplicationId - the id of the application for which to locate an available proxy for the
given service name
public ServiceConfiguration publishService(ServiceDefinition serviceDefinition,
boolean synchronize)
ServiceBus
The method also provides the ability for the service bus to immediately synchronize with the
service registry after registering the service if synchronize is set to true.
publishService in interface ServiceBusserviceDefinition - the definition of the service to publish, must not be nullsynchronize - indicates whether or not this service bus client should immediately
synchronize it's changes with the registry after registering the service.
ServiceBus.synchronize()
public List<ServiceConfiguration> publishServices(List<ServiceDefinition> serviceDefinitions,
boolean synchronize)
ServiceBusServiceBus.publishService(ServiceDefinition, boolean) but allows for multiple
services to be published to the bus in a single operation. If the given list of service
definitions is empty then this method will do nothing (including skipping synchronization
with the registry if that was requested).
publishServices in interface ServiceBusserviceDefinitions - the list of definition for the services to publish, must not be
nullsynchronize - indicates whether or not this service bus client should immediately
synchronize it's changes with the registry after registering the services.
ServiceBus.publishService(ServiceDefinition, boolean),
ServiceBus.synchronize()
public boolean removeService(QName serviceName,
boolean synchronize)
ServiceBus
This method also provides the ability for the service bus to immediately synchronize with the
service registry after removing the service if synchronize is set to true. If
the service is not located and successfully removed, however, the sychronization will not
run.
removeService in interface ServiceBusserviceName - the name of the service to removesynchronize - indicates whether or not this service bus client should immediately
synchronize after removing the service
ServiceBus.synchronize()
public List<Boolean> removeServices(List<QName> serviceNames,
boolean synchronize)
ServiceBusServiceBus.removeService(QName, boolean) but allows for multiple services to
be removed from the bus in a single operation. If the given list of service names is empty
then this method will do nothing (including skipping synchronization with the registry if
that was requested).
If the list returned from the method contains only false responses (meaning that no services were removed) this method will skip synchronization even if it is requested.
removeServices in interface ServiceBusserviceNames - the list of names for the services to remove, must not be nullsynchronize - indicates whether or not this service bus client should immediately
synchronize it's changes with the registry after removing the services.
ServiceBus.removeService(QName, boolean),
ServiceBus.synchronize()public void synchronize()
ServiceBus
synchronize in interface ServiceBusprotected void processRemoteServiceDiff(RemoteServicesDiff remoteServicesDiff)
protected void processLocalServiceDiff(LocalServicesDiff localServicesDiff)
protected ServiceEndpoint rebuildServiceEndpointForUpdate(ServiceEndpoint originalEndpoint,
ServiceInfo registryServiceInfo)
protected void rebuildLocalServiceEndpointAfterPublishing(ServiceEndpoint publishedService)
public void setServiceRegistry(ServiceRegistry serviceRegistry)
public void setDiffCalculator(ServiceRegistryDiffCalculator diffCalculator)
public void setServiceExportManager(ServiceExportManager serviceExportManager)
public void setScheduledPool(KSBScheduledPool scheduledPool)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||