biz.hammurapi.util
Class CompositeWorkerContainer

java.lang.Object
  extended by biz.hammurapi.util.CompositeWorkerContainer
All Implemented Interfaces:
Component, Context, DomConfigurable, Worker

public class CompositeWorkerContainer
extends java.lang.Object
implements Component, DomConfigurable, Worker, Context

Simple container

Author:
Pavel Vlasov

Constructor Summary
CompositeWorkerContainer()
           
 
Method Summary
 void configure(org.w3c.dom.Node configNode, Context context)
          Reads configuration from Node
 java.lang.Object get(java.lang.String name)
          Looks up component in component tree.
 boolean post(java.lang.Runnable job)
          Gives job to workers until one of them accepts it.
 void setOwner(java.lang.Object owner)
          Plugs the component into container and naming bus.
 void start()
          Invoked by container before the first use.
 void stop()
          Invoked by container when component is not needed anymore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeWorkerContainer

public CompositeWorkerContainer()
Method Detail

get

public java.lang.Object get(java.lang.String name)
Looks up component in component tree.

Specified by:
get in interface Context
Parameters:
name -
Returns:

start

public void start()
           throws ConfigurationException
Description copied from interface: Component
Invoked by container before the first use. Component shall perform initialization in this method.

Specified by:
start in interface Component
Throws:
ConfigurationException

stop

public void stop()
          throws ConfigurationException
Description copied from interface: Component
Invoked by container when component is not needed anymore. Component shall perform cleanup in this method.

Specified by:
stop in interface Component
Throws:
ConfigurationException

setOwner

public void setOwner(java.lang.Object owner)
Description copied from interface: Component
Plugs the component into container and naming bus.

Specified by:
setOwner in interface Component

configure

public void configure(org.w3c.dom.Node configNode,
                      Context context)
               throws ConfigurationException
Description copied from interface: DomConfigurable
Reads configuration from Node

Specified by:
configure in interface DomConfigurable
Throws:
ConfigurationException

post

public boolean post(java.lang.Runnable job)
Gives job to workers until one of them accepts it.

Specified by:
post in interface Worker
Returns:
true if worker accepted job. There can be situations when worker cannot accept job. E.g. remote worker cannot accept non-serializable job.


Copyright © 2003 Hammurapi Group. All Rights Reserved.