org.apache.xbean.kernel
Class ServiceEvent

java.lang.Object
  extended byorg.apache.xbean.kernel.ServiceEvent

public class ServiceEvent
extends java.lang.Object

This class holds information about a service event.

Since:
2.0
Version:
$Id$
Author:
Dain Sundstrom

Constructor Summary
ServiceEvent(long eventId, Kernel kernel, ServiceName serviceName, ServiceFactory serviceFactory, java.lang.ClassLoader classLoader, java.lang.Object service, java.lang.Throwable cause, java.util.Set unsatisfiedConditions)
          Creates a service event.
 
Method Summary
 java.lang.Throwable getCause()
          Gets the error that was thrown during startup or shutdown.
 java.lang.ClassLoader getClassLoader()
          Gets the class loader for the service.
 long getEventId()
          Gets the sequence number for this event.
 Kernel getKernel()
          Gets the kernel in which the service is registered.
 java.lang.Object getService()
          Gets the service instance or null if the service doesn't exist.
 ServiceFactory getServiceFactory()
          Gets the service factory for the service.
 ServiceName getServiceName()
          Gets the name of the service.
 java.util.Set getUnsatisfiedConditions()
          Gets the unsatified dependencies that cause the service to wait.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceEvent

public ServiceEvent(long eventId,
                    Kernel kernel,
                    ServiceName serviceName,
                    ServiceFactory serviceFactory,
                    java.lang.ClassLoader classLoader,
                    java.lang.Object service,
                    java.lang.Throwable cause,
                    java.util.Set unsatisfiedConditions)
Creates a service event.

Parameters:
eventId - the sequence number for this event
kernel - the kernel in which the service is registered
serviceName - the name of the service
serviceFactory - the factory for the service
classLoader - the class loader for the service
service - the service instance if it exists
cause - the exception that caused the event if this is an exception event
unsatisfiedConditions - the unsatified conditions that caused the event if this is a waiting event
Method Detail

getEventId

public long getEventId()
Gets the sequence number for this event. A service gaurentees that events will occur in increasing order with out skipping any numbers.

Returns:
the sequence number for this event

getKernel

public Kernel getKernel()
Gets the kernel in which the service is registered.

Returns:
the kernel in which the servce is registerd

getServiceName

public ServiceName getServiceName()
Gets the name of the service.

Returns:
the name of the service

getServiceFactory

public ServiceFactory getServiceFactory()
Gets the service factory for the service.

Returns:
the service factory for the service

getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the class loader for the service.

Returns:
the class loader for the service

getService

public java.lang.Object getService()
Gets the service instance or null if the service doesn't exist.

Returns:
the service instance

getCause

public java.lang.Throwable getCause()
Gets the error that was thrown during startup or shutdown. This is available only in error events.

Returns:
the error

getUnsatisfiedConditions

public java.util.Set getUnsatisfiedConditions()
Gets the unsatified dependencies that cause the service to wait. This is available only in waiting events.

Returns:
the unsatified dependencies that cause the service to wait


Copyright © {inceptionYear}-2006 Apache Software Foundation. All Rights Reserved.