org.jboss.portal.wsrp.services
Class CachingServiceFactory

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.portal.jems.as.system.AbstractJBossService
              extended by org.jboss.portal.wsrp.services.CachingServiceFactory
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ManageableServiceFactory, ServiceFactory, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class CachingServiceFactory
extends AbstractJBossService
implements ManageableServiceFactory

A service factory that statically cache implementations. It is mainly used in the test environment to void the very expensive creation of SOAP service proxies.

Version:
$Revision: 11516 $
Author:
Julien Viet

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
CachingServiceFactory()
           
 
Method Summary
 ManageableServiceFactory getDelegate()
           
 java.lang.String getMarkupURL()
           
 java.lang.String getPortletManagementURL()
           
 java.lang.String getRegistrationURL()
           
<T extends java.rmi.Remote>
T
getService(java.lang.Class<T> clazz)
           
 java.lang.String getServiceDescriptionURL()
           
 boolean isAvailable()
          Determines whether or not this ServiceFactory is able to provide services.
 boolean isFailed()
          Determines whether or not this ServiceFactory is in a permanent state of failure which cannot be recovered from without user intervention.
 void setAvailable(boolean available)
           
 void setDelegate(ManageableServiceFactory delegate)
           
 void setFailed(boolean failed)
           
 void setMarkupURL(java.lang.String markupURL)
           
 void setPortletManagementURL(java.lang.String portletManagementURL)
           
 void setRegistrationURL(java.lang.String registrationURL)
           
 void setServiceDescriptionURL(java.lang.String serviceDescriptionURL)
           
 
Methods inherited from class org.jboss.portal.jems.as.system.AbstractJBossService
create, destroy, getState, getStateString, start, stop
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
createService, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, startService, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

CachingServiceFactory

public CachingServiceFactory()
Method Detail

getService

public <T extends java.rmi.Remote> T getService(java.lang.Class<T> clazz)
                                     throws java.lang.Exception
Specified by:
getService in interface ServiceFactory
Throws:
java.lang.Exception

getDelegate

public ManageableServiceFactory getDelegate()

setDelegate

public void setDelegate(ManageableServiceFactory delegate)

isAvailable

public boolean isAvailable()
Description copied from interface: ServiceFactory
Determines whether or not this ServiceFactory is able to provide services. A non-available ServiceFactory might be in a temporary state of non-availability (e.g. if the remote host is not currently reachable) or permanently (because, e.g. its configuration is invalid). Permanent failure is indicated by ServiceFactory.isFailed() status.

Specified by:
isAvailable in interface ServiceFactory
Returns:
true if this ServiceFactory is ready to provide services, false otherwise.

isFailed

public boolean isFailed()
Description copied from interface: ServiceFactory
Determines whether or not this ServiceFactory is in a permanent state of failure which cannot be recovered from without user intervention. This notably happens if the configuration is incorrect (i.e. remote host URLs are invalid).

Specified by:
isFailed in interface ServiceFactory
Returns:
true if this ServiceFactory is not configured properly, false otherwise.

setFailed

public void setFailed(boolean failed)
Specified by:
setFailed in interface ManageableServiceFactory

setAvailable

public void setAvailable(boolean available)
Specified by:
setAvailable in interface ManageableServiceFactory

getServiceDescriptionURL

public java.lang.String getServiceDescriptionURL()
Specified by:
getServiceDescriptionURL in interface ServiceFactory

getMarkupURL

public java.lang.String getMarkupURL()
Specified by:
getMarkupURL in interface ServiceFactory

getRegistrationURL

public java.lang.String getRegistrationURL()
Specified by:
getRegistrationURL in interface ServiceFactory

getPortletManagementURL

public java.lang.String getPortletManagementURL()
Specified by:
getPortletManagementURL in interface ServiceFactory

setServiceDescriptionURL

public void setServiceDescriptionURL(java.lang.String serviceDescriptionURL)
Specified by:
setServiceDescriptionURL in interface ServiceFactory

setMarkupURL

public void setMarkupURL(java.lang.String markupURL)
Specified by:
setMarkupURL in interface ServiceFactory

setRegistrationURL

public void setRegistrationURL(java.lang.String registrationURL)
Specified by:
setRegistrationURL in interface ServiceFactory

setPortletManagementURL

public void setPortletManagementURL(java.lang.String portletManagementURL)
Specified by:
setPortletManagementURL in interface ServiceFactory