|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.axis2.transport.base.tracker.AxisServiceTracker
public class AxisServiceTracker
Tracks services deployed in a given AxisConfiguration
.
The tracker is configured with references to three objects:
AxisConfiguration
to watch.AxisServiceFilter
restricting the services to track.AxisServiceTrackerListener
receiving tracking events.An instance of this class maintains an up-to-date list of services satisfying all of the following criteria:
AxisConfiguration
.AxisService.isActive()
returns true.AxisServiceFilter
instance.Whenever a service appears on the list, the tracker will call
AxisServiceTrackerListener.serviceAdded(AxisService)
. When a service disappears, it
will call AxisServiceTrackerListener.serviceRemoved(AxisService)
.
When the tracker is created, it is initially in the stopped state. In this state no
events will be sent to the listener. It can be started using start()
and stopped again
using stop()
. The tracker list is defined to be empty when the tracker is in the
stopped state. This implies that a call to start()
will generate
AxisServiceTrackerListener.serviceAdded(AxisService)
events for all services that meet
the above criteria at that point in time. In the same way, stop()
will generate
AxisServiceTrackerListener.serviceRemoved(AxisService)
events for the current entries
in the list.
As a corollary the tracker guarantees that during a complete lifecycle (start-stop),
there will be exactly one AxisServiceTrackerListener.serviceRemoved(AxisService)
event
for every AxisServiceTrackerListener.serviceAdded(AxisService)
event and vice-versa.
This property is important when the tracker is used to allocate resources for a dynamic set
of services.
The tracker is not able to detect property changes on services. E.g. if a service initially matches the filter criteria, but later changes so that it doesn't match the criteria any more, the tracker will not be able to detect this and the service will not be removed from the tracker list.
Constructor Summary | |
---|---|
AxisServiceTracker(org.apache.axis2.engine.AxisConfiguration config,
AxisServiceFilter filter,
AxisServiceTrackerListener listener)
|
Method Summary | |
---|---|
boolean |
isStarted()
Check whether the tracker is started. |
void |
start()
Start the tracker. |
void |
stop()
Stop the tracker. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AxisServiceTracker(org.apache.axis2.engine.AxisConfiguration config, AxisServiceFilter filter, AxisServiceTrackerListener listener)
Method Detail |
---|
public boolean isStarted()
true
if the tracker is startedpublic void start()
java.lang.IllegalStateException
- if the tracker has already been startedpublic void stop()
java.lang.IllegalStateException
- if the tracker is not started
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |