org.jboss.portal.wsrp.services
Class AbstractJNDIServiceFactory

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.AbstractJNDIServiceFactory
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ManageableServiceFactory, ServiceFactory, org.jboss.system.Service, org.jboss.system.ServiceMBean
Direct Known Subclasses:
AbstractSOAPServiceFactory

public abstract class AbstractJNDIServiceFactory
extends AbstractJBossService
implements ManageableServiceFactory

A service factory implementation that get the services using JNDI lookups.

Since:
2.4
Version:
$Revision: 11483 $
Author:
Julien Viet, Chris Laprun

Field Summary
protected  boolean available
          Whether or not this ServiceFactory is availble to provide services
protected  boolean failed
          Whether or not this ServiceFactory has an unrecoverable error condition
protected  org.jboss.logging.Logger log
          The logger.
protected  java.util.Properties portJNDIMapping
          A Map recording the mapping between WSRP port type class name and JDNI name of the implementing service.
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
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
AbstractJNDIServiceFactory()
           
 
Method Summary
protected  void createService()
           
 java.util.Properties getEnv()
           
 java.util.Properties getPortJNDIMapping()
           
protected
<T extends java.rmi.Remote>
javax.xml.rpc.Service
getServiceFor(java.lang.Class<T> serviceClass)
           
 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 setEnv(java.util.Properties env)
           
 void setFailed(boolean failed)
           
 void setPortJNDIMapping(java.util.Properties portJNDIMapping)
           
 
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
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.portal.wsrp.services.ServiceFactory
getMarkupURL, getPortletManagementURL, getRegistrationURL, getService, getServiceDescriptionURL, setMarkupURL, setPortletManagementURL, setRegistrationURL, setServiceDescriptionURL
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

log

protected final org.jboss.logging.Logger log
The logger.


failed

protected boolean failed
Whether or not this ServiceFactory has an unrecoverable error condition


available

protected boolean available
Whether or not this ServiceFactory is availble to provide services


portJNDIMapping

protected java.util.Properties portJNDIMapping
A Map recording the mapping between WSRP port type class name and JDNI name of the implementing service.

Constructor Detail

AbstractJNDIServiceFactory

public AbstractJNDIServiceFactory()
Method Detail

createService

protected void createService()
                      throws java.lang.Exception
Overrides:
createService in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

getEnv

public java.util.Properties getEnv()

setEnv

public void setEnv(java.util.Properties env)

getServiceFor

protected <T extends java.rmi.Remote> javax.xml.rpc.Service getServiceFor(java.lang.Class<T> serviceClass)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

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

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.

setAvailable

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

getPortJNDIMapping

public java.util.Properties getPortJNDIMapping()

setPortJNDIMapping

public void setPortJNDIMapping(java.util.Properties portJNDIMapping)