Class AbstractProcessStartEventBean
- java.lang.Object
-
- ch.ivyteam.ivy.process.eventstart.AbstractProcessStartEventBean
-
- All Implemented Interfaces:
IProcessStartEventBean
public abstract class AbstractProcessStartEventBean extends Object implements IProcessStartEventBean
Abstract implementation of a process start event bean. Implementors of process start event beans may extend this class- Since:
- 23.01.2007
- API:
- This is a public API.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractProcessStartEventBean(String _name, String _description)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getConfiguration()
Gets the process start event bean configurationString
getDescription()
Gets a description what this process start event bean does.protected IProcessStartEventBeanRuntime
getEventBeanRuntime()
Gets the process start event bean runtimeString
getName()
Gets the name of the process start event beanvoid
initialize(IProcessStartEventBeanRuntime _eventRuntime, String _configuration)
Initializes the process start event beanboolean
isMoreThanOneInstanceSupported()
Does this event bean allow/support that it is instanciated more than once for a certain path.boolean
isRunning()
True if the process start event bean was started.void
poll()
This method is called by the process start event bean runtime perodically.void
start(org.eclipse.core.runtime.IProgressMonitor monitor)
Starts the process start event bean.void
stop(org.eclipse.core.runtime.IProgressMonitor monitor)
Stops the process start event bean.
-
-
-
Method Detail
-
getConfiguration
protected String getConfiguration()
Gets the process start event bean configuration- Returns:
- the configuration
- API:
- This public API is available in Java.
-
getEventBeanRuntime
protected IProcessStartEventBeanRuntime getEventBeanRuntime()
Gets the process start event bean runtime- Returns:
- the process start event bean runtime
- API:
- This public API is available in Java.
-
getDescription
public String getDescription()
Description copied from interface:IProcessStartEventBean
Gets a description what this process start event bean does.- Specified by:
getDescription
in interfaceIProcessStartEventBean
- Returns:
- description what this process start event bean does.
- See Also:
IProcessStartEventBean.getDescription()
- API:
- This public API is available in Java.
-
getName
public String getName()
Description copied from interface:IProcessStartEventBean
Gets the name of the process start event bean- Specified by:
getName
in interfaceIProcessStartEventBean
- Returns:
- name of the process start event bean
- See Also:
IProcessStartEventBean.getName()
- API:
- This public API is available in Java.
-
initialize
public void initialize(IProcessStartEventBeanRuntime _eventRuntime, String _configuration)
Description copied from interface:IProcessStartEventBean
Initializes the process start event bean- Specified by:
initialize
in interfaceIProcessStartEventBean
- Parameters:
_eventRuntime
- the event runtime. The process start event bean can fire events to the event runtime_configuration
- the configuration of the process start event bean- See Also:
IProcessStartEventBean.initialize(ch.ivyteam.ivy.process.eventstart.IProcessStartEventBeanRuntime, java.lang.String)
- API:
- This public API is available in Java.
-
isMoreThanOneInstanceSupported
public boolean isMoreThanOneInstanceSupported()
Description copied from interface:IProcessStartEventBean
Does this event bean allow/support that it is instanciated more than once for a certain path. If not supported the process start event bean is instanced only once. On a cluster typically on the master node. If supported the process start event bean can be instanced more once. On a cluster typically once on each node.- Specified by:
isMoreThanOneInstanceSupported
in interfaceIProcessStartEventBean
- Returns:
- true if more than one instance is supported, otherwise false
- See Also:
IProcessStartEventBean.isMoreThanOneInstanceSupported()
- API:
- This public API is available in Java.
-
isRunning
public boolean isRunning()
Description copied from interface:IProcessStartEventBean
True if the process start event bean was started. The process start event bean is by default not started. E.g. if the event bean is instanciated the method must return false. After the methodIProcessStartEventBean.start(org.eclipse.core.runtime.IProgressMonitor)
was called the method should return true.- Specified by:
isRunning
in interfaceIProcessStartEventBean
- Returns:
- true if started, false if stopped.
- See Also:
IProcessStartEventBean.isRunning()
- API:
- This public API is available in Java.
-
poll
public void poll()
Description copied from interface:IProcessStartEventBean
This method is called by the process start event bean runtime perodically. Default time interval is one minute. It can be used to poll for something that fires an event.
This allows to share polling threads between event beans.
Note that it is not necessary to create an own thread to fire an event as this was necessary with earlier version (<=3.8). You can configure the time interval by usingIProcessStartEventBeanRuntime.setPollTimeInterval(long)
. Note that the runtime can call this method more than once on an instance if the poll method last longer than the configured runtime interval. Implementors have to consider this fact.- Specified by:
poll
in interfaceIProcessStartEventBean
- See Also:
IProcessStartEventBean.poll()
- API:
- This public API is available in Java.
-
start
public void start(org.eclipse.core.runtime.IProgressMonitor monitor) throws ch.ivyteam.ivy.service.ServiceException
Description copied from interface:IProcessStartEventBean
Starts the process start event bean. The process start event bean is allowed to fire events after it is started. The event bean must not fire events if it is not started.- Specified by:
start
in interfaceIProcessStartEventBean
- Parameters:
monitor
- the progress monitor- Throws:
ch.ivyteam.ivy.service.ServiceException
- if event bean cannot be started.IProcessStartEventBean.isRunning()
must return false if start has thrown this exception.- See Also:
IProcessStartEventBean.start(IProgressMonitor)
- API:
- This public API is available in Java.
-
stop
public void stop(org.eclipse.core.runtime.IProgressMonitor monitor) throws ch.ivyteam.ivy.service.ServiceException
Description copied from interface:IProcessStartEventBean
Stops the process start event bean. The process start event bean must not fire events if it is stopped.- Specified by:
stop
in interfaceIProcessStartEventBean
- Parameters:
monitor
- the progress monitor- Throws:
ch.ivyteam.ivy.service.ServiceException
- if process start event bean cannot be stopped.IProcessStartEventBean.isRunning()
must return true if stop has thrown this exception.- See Also:
IProcessStartEventBean.stop(IProgressMonitor)
- API:
- This public API is available in Java.
-
-