org.sca4j.host.runtime
Interface SCA4JRuntime<HI extends HostInfo>


public interface SCA4JRuntime<HI extends HostInfo>

Represents a node in the service network. Runtimes may host components and/or function as a Domain controller.

Version:
$Rev: 5395 $ $Date: 2008-09-13 14:35:47 +0100 (Sat, 13 Sep 2008) $

Method Summary
 void bootPrimordial(BootConfiguration configuration)
          Boots the runtime with its primordial components.
 void bootSystem()
          Initialize a runtime.
 java.lang.ClassLoader getHostClassLoader()
          Returns the host ClassLoader that is parent to all SCA4J classloaders.
 HI getHostInfo()
          Returns the info this runtime will make available to service components.
 java.lang.Class<HI> getHostInfoType()
          Returns the type of info supplied by the host.
 java.lang.String getJMXSubDomain()
          Returns the JMX sub domain this runtime should use.
 javax.management.MBeanServer getMBeanServer()
          Returns the MBeanServer this runtime should use.
 org.sca4j.monitor.MonitorFactory getMonitorFactory()
          Returns the MonitorFactory that this runtime is using.
<I> I
getSystemComponent(java.lang.Class<I> service, java.net.URI uri)
          Returns the system component providing the designated service.
 void joinDomain(long timeout)
          Join the domain in a non-blocking fashion.
 void setHostInfo(HI hostInfo)
          Sets the info this runtime should make available to service components.
 void setJmxSubDomain(java.lang.String jmxSubDomain)
          Sets the JMX sub domain this runtime should use.
 void setMBeanServer(javax.management.MBeanServer mbServer)
          Sets the MBeanServer this runtime should use.
 void setMonitorFactory(org.sca4j.monitor.MonitorFactory monitorFactory)
          Sets the MonitorFactory that this runtime should use.
 void shutdown()
          Shuts the runtime down, stopping it from receiving requests and detaching it from the domain.
 void start()
          Starts the runtime.
 

Method Detail

getHostClassLoader

java.lang.ClassLoader getHostClassLoader()
Returns the host ClassLoader that is parent to all SCA4J classloaders.

Returns:
the host's ClassLoader

getHostInfoType

java.lang.Class<HI> getHostInfoType()
Returns the type of info supplied by the host.

Returns:
the type of info supplied by the host

getHostInfo

HI getHostInfo()
Returns the info this runtime will make available to service components.

Returns:
the info this runtime will make available to service components

setHostInfo

void setHostInfo(HI hostInfo)
Sets the info this runtime should make available to service components.

Parameters:
hostInfo - the information this runtime should make available to service components

getMonitorFactory

org.sca4j.monitor.MonitorFactory getMonitorFactory()
Returns the MonitorFactory that this runtime is using.

Returns:
the MonitorFactory that this runtime is using

setMonitorFactory

void setMonitorFactory(org.sca4j.monitor.MonitorFactory monitorFactory)
Sets the MonitorFactory that this runtime should use.

Parameters:
monitorFactory - the MonitorFactory that this runtime should use

getMBeanServer

javax.management.MBeanServer getMBeanServer()
Returns the MBeanServer this runtime should use.

Returns:
the MBeanServer

setMBeanServer

void setMBeanServer(javax.management.MBeanServer mbServer)
Sets the MBeanServer this runtime should use.

This allows the host environment to specify an MBeanServer with which any manageable runtime components should be registered.

Parameters:
mbServer - the MBeanServer this runtime should use

getJMXSubDomain

java.lang.String getJMXSubDomain()
Returns the JMX sub domain this runtime should use.

Returns:
the JMX sub domain this runtime should use

setJmxSubDomain

void setJmxSubDomain(java.lang.String jmxSubDomain)
Sets the JMX sub domain this runtime should use.

This will be used as the sub domain portion of the ObjectName for all MBeans registered with the MBeanServer

Parameters:
jmxSubDomain - the JMX domain this runtime should use

bootSystem

void bootSystem()
                throws InitializationException
Initialize a runtime. An initialized runtime has has completed core service initialization, recovery operations, and is ready to be started.

Throws:
InitializationException - if there is an error initializing the runtime

start

void start()
           throws StartException
Starts the runtime. A runtime is ready to process requests when it has been started.

Throws:
StartException - if there is an error starting the runtime

getSystemComponent

<I> I getSystemComponent(java.lang.Class<I> service,
                         java.net.URI uri)
Returns the system component providing the designated service.

Type Parameters:
I - the Java type for the service interface
Parameters:
service - the service interface required
uri - the id of the system component
Returns:
an implementation of the requested service

bootPrimordial

void bootPrimordial(BootConfiguration configuration)
                    throws InitializationException
Boots the runtime with its primordial components.

Throws:
InitializationException - if an error occurs booting the runtime

joinDomain

void joinDomain(long timeout)
                throws InitializationException
Join the domain in a non-blocking fashion.

Parameters:
timeout - the timeout in milliseconds or -1 if the operation should wait indefinitely
Throws:
InitializationException - if an error occurs joining the domain

shutdown

void shutdown()
Shuts the runtime down, stopping it from receiving requests and detaching it from the domain. In-flight synchronous operations will be allowed to proceed to completion.

Throws:
ShutdownException - if an error ocurrs shutting down the runtime


Copyright © 2008-2010 Service Symphony. All Rights Reserved.