org.kuali.rice.ksb.messaging
Class RemoteResourceServiceLocatorImpl

java.lang.Object
  extended by org.kuali.rice.core.lifecycle.BaseLifecycle
      extended by org.kuali.rice.core.resourceloader.ResourceLoaderContainer
          extended by org.kuali.rice.ksb.messaging.RemoteResourceServiceLocatorImpl
All Implemented Interfaces:
Runnable, Lifecycle, ObjectLoader, ResourceLoader, ServiceLocator, RemoteResourceServiceLocator

public class RemoteResourceServiceLocatorImpl
extends ResourceLoaderContainer
implements Runnable, RemoteResourceServiceLocator


Field Summary
private  Map<QName,List<RemotedServiceHolder>> clients
           
private  Object clientsMutex
           
private  ScheduledFuture future
           
private static org.apache.log4j.Logger LOG
           
private  Random randomNumber
           
private  boolean started
           
 
Fields inherited from interface org.kuali.rice.core.resourceloader.ResourceLoader
EMBEDDED_CLIENT_APP_RESOURCE_LOADER, EMBEDDED_PLUGIN, KSB_CONFIGURER_CONTAINER_NAME, PLUGIN_REGISTRY_LOADER_NAME, RMI_PLUGIN, ROOT_RESOURCE_LOADER_NAME, WEB_SERVICE_PLUGIN
 
Constructor Summary
RemoteResourceServiceLocatorImpl(QName name)
           
 
Method Summary
 List<RemotedServiceHolder> getAllServices(QName qName)
          Returns an immutable list of services.
 Map<QName,List<RemotedServiceHolder>> getClients()
           
 MessageExceptionHandler getMessageExceptionHandler(QName qname)
           
 Object getObject(ObjectDefinition definition)
          Constructs an instance of the Object using the given ObjectDefinition classname.
 ServiceHolder getRemotedServiceHolderFromList(List<RemotedServiceHolder> remotedServices)
           
 Object getService(QName serviceName)
          Fetches a service from the client proxies configured in this resource loader.
 Object getService(QName qName, String url)
           
 List<QName> getServiceNamesForUnqualifiedName(String unqualifiedServiceName)
           
protected  void installAlternateEndpoint(ServiceInfo serviceInfo)
           
 boolean isStarted()
           
 void refresh()
           
private  void registerClient(ServiceInfo serviceInfo, Map<QName,List<RemotedServiceHolder>> clientMap)
           
 void removeService(ServiceInfo serviceInfo)
           
private  boolean removeServiceFromCollection(ServiceInfo serviceInfo, List<RemotedServiceHolder> serviceList)
          Removes a service (its RemotedServiceHolder wrapper) from the list of services.
 void run()
           
 void setClients(Map<QName,List<RemotedServiceHolder>> clients)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.kuali.rice.core.resourceloader.ResourceLoaderContainer
addResourceLoader, addResourceLoaderFirst, containsResourceLoader, getContents, getName, getResourceLoader, getResourceLoaderNames, getResourceLoaders, removeAllResourceLoaders, removeResourceLoader, setName, toString
 
Methods inherited from class org.kuali.rice.core.lifecycle.BaseLifecycle
setStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.core.resourceloader.ResourceLoader
addResourceLoader, addResourceLoaderFirst, getContents, getName, getResourceLoader, getResourceLoaderNames, getResourceLoaders, removeResourceLoader, setName
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

randomNumber

private Random randomNumber

started

private boolean started

future

private ScheduledFuture future

clients

private Map<QName,List<RemotedServiceHolder>> clients

clientsMutex

private Object clientsMutex
Constructor Detail

RemoteResourceServiceLocatorImpl

public RemoteResourceServiceLocatorImpl(QName name)
Method Detail

removeService

public void removeService(ServiceInfo serviceInfo)
Specified by:
removeService in interface RemoteResourceServiceLocator

removeServiceFromCollection

private boolean removeServiceFromCollection(ServiceInfo serviceInfo,
                                            List<RemotedServiceHolder> serviceList)
Removes a service (its RemotedServiceHolder wrapper) from the list of services. This isn't very efficient but for time reasons hashcode and equals wasn't implemented on the RemotedServiceHolder and IPTable, which is a member of the RemotedServiceHolder.

Parameters:
service -
serviceList -
Returns:
boolean indicating if the entry was removed from the list

getService

public Object getService(QName serviceName)
Fetches a service from the client proxies configured in this resource loader.

Specified by:
getService in interface ServiceLocator
Overrides:
getService in class ResourceLoaderContainer

getService

public Object getService(QName qName,
                         String url)
Specified by:
getService in interface RemoteResourceServiceLocator

getServiceNamesForUnqualifiedName

public List<QName> getServiceNamesForUnqualifiedName(String unqualifiedServiceName)
Specified by:
getServiceNamesForUnqualifiedName in interface RemoteResourceServiceLocator

getRemotedServiceHolderFromList

public ServiceHolder getRemotedServiceHolderFromList(List<RemotedServiceHolder> remotedServices)

getAllServices

public List<RemotedServiceHolder> getAllServices(QName qName)
Returns an immutable list of services.

Specified by:
getAllServices in interface RemoteResourceServiceLocator

refresh

public void refresh()
Specified by:
refresh in interface RemoteResourceServiceLocator

run

public void run()
Specified by:
run in interface Runnable

registerClient

private void registerClient(ServiceInfo serviceInfo,
                            Map<QName,List<RemotedServiceHolder>> clientMap)

installAlternateEndpoint

protected void installAlternateEndpoint(ServiceInfo serviceInfo)

isStarted

public boolean isStarted()
Specified by:
isStarted in interface Lifecycle
Overrides:
isStarted in class BaseLifecycle

start

public void start()
           throws Exception
Specified by:
start in interface Lifecycle
Overrides:
start in class ResourceLoaderContainer
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Lifecycle
Overrides:
stop in class ResourceLoaderContainer
Throws:
Exception

getObject

public Object getObject(ObjectDefinition definition)
Description copied from interface: ObjectLoader
Constructs an instance of the Object using the given ObjectDefinition classname.

Specified by:
getObject in interface ObjectLoader
Overrides:
getObject in class ResourceLoaderContainer

getMessageExceptionHandler

public MessageExceptionHandler getMessageExceptionHandler(QName qname)
Specified by:
getMessageExceptionHandler in interface RemoteResourceServiceLocator

getClients

public Map<QName,List<RemotedServiceHolder>> getClients()
Specified by:
getClients in interface RemoteResourceServiceLocator

setClients

public void setClients(Map<QName,List<RemotedServiceHolder>> clients)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.