org.apache.avalon.cornerstone.threads.tutorial
Class ThreadConsumer
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.cornerstone.threads.tutorial.ThreadConsumer
- All Implemented Interfaces:
- Disposable, Initializable, LogEnabled, Serviceable
- public class ThreadConsumer
- extends AbstractLogEnabled
- implements Serviceable, Initializable, Disposable
ThreadConsumer is a example of a component that uses the ThreadManager
service to aquired a thread pool.
- Author:
- Stephen McConnell
- Component:
- name="consumer" lifestyle="singleton" version="1.0"
Method Summary |
void |
dispose()
Disposal of the component during which he handle the closue of the
child thread we have establshed during the initialization stage. |
void |
initialize()
Initialization of the component by the container during which we
establish a child thread by passing a runnable object to the thread pool. |
void |
service(ServiceManager manager)
Servicing of the component by the container during which the
component aquires the ThreadManager service. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadConsumer
public ThreadConsumer()
service
public void service(ServiceManager manager)
throws ServiceException
- Servicing of the component by the container during which the
component aquires the ThreadManager service.
- Specified by:
service
in interface Serviceable
- Parameters:
manager
- the thread manager
- Throws:
ServiceException
- if the thread manager service is
unresolvable- Service Dependency:
- key="threads"
type="org.apache.avalon.cornerstone.services.threads.ThreadManager"
initialize
public void initialize()
throws Exception
- Initialization of the component by the container during which we
establish a child thread by passing a runnable object to the thread pool.
- Specified by:
initialize
in interface Initializable
- Throws:
Exception
- if an initialization stage error occurs
dispose
public void dispose()
- Disposal of the component during which he handle the closue of the
child thread we have establshed during the initialization stage.
- Specified by:
dispose
in interface Disposable
Copyright © Apache Software Foundation. All Rights Reserved.