Top Description Fields Constructors Methods
org.osgi.service.wireadmin

public Class WireAdminEvent

extends Object
Class Inheritance
Imports
org.osgi.framework.ServiceReference

A Wire Admin Event.

WireAdminEvent objects are delivered to all registered WireAdminListener service objects which specify an interest in the WireAdminEvent type. Events must be delivered in chronological order with respect to each listener. For example, a WireAdminEvent of type WIRE_CONNECTED must be delivered before a WireAdminEvent of type WIRE_DISCONNECTED for a particular Wire object.

A type code is used to identify the type of event. The following event types are defined:

Additional event types may be defined in the future.

Event type values must be unique and disjoint bit values. Event types must be defined as a bit in a 32 bit integer and can thus be bitwise ORed together.

Security Considerations. WireAdminEvent objects contain Wire objects. Care must be taken in the sharing of Wire objects with other bundles.

Author
$Id: ac5435a7db44132fe343758d9c36dfb69e6e5064 $
See Also
WireAdminListener

Field Summary

Modifier and TypeField and Description
public static final int
CONSUMER_EXCEPTION

A Consumer service method has thrown an exception.

public static final int
PRODUCER_EXCEPTION

A Producer service method has thrown an exception.

private final ServiceReference<WireAdmin>
reference

The WireAdmin service which created this event.

private final Throwable
throwable

Exception associates with this the event.

private final int
type

Type of this event.

private final Wire
wire

The Wire object associated with this event.

public static final int
WIRE_CONNECTED

The WireAdminEvent type that indicates that an existing Wire object has become connected.

public static final int
WIRE_CREATED

A Wire has been created.

public static final int
WIRE_DELETED

A Wire has been deleted.

public static final int
WIRE_DISCONNECTED

The WireAdminEvent type that indicates that an existing Wire object has become disconnected.

public static final int
WIRE_TRACE

The WireAdminEvent type that indicates that a new value is transferred over the Wire object.

public static final int
WIRE_UPDATED

A Wire has been updated.

Constructor Summary

AccessConstructor and Description
public
WireAdminEvent(ServiceReference<WireAdmin>
The ServiceReference object of the Wire Admin service that created this event.
reference
,
int
The event type. See getType().
type
,
Wire
The Wire object associated with this event.
wire
,
Throwable
An exception associated with this event. This may be null if no exception is associated with this event.
exception
)

Constructs a WireAdminEvent object from the given ServiceReference object, event type, Wire object and exception.

Method Summary

Modifier and TypeMethod and Description
public ServiceReference<WireAdmin>

Returns:

The ServiceReference object for the Wire Admin service that created this event.
getServiceReference
()

Return the ServiceReference object of the Wire Admin service that created this event.

public Throwable

Returns:

An exception or null if no exception is associated with this event.
getThrowable
()

Returns the exception associated with the event, if any.

public int

Returns:

The type of this event.
getType
()

Return the type of this event.

public Wire

Returns:

The Wire object associated with this event or null when no Wire object is associated with the event.
getWire
()

Return the Wire object associated with this event.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONSUMER_EXCEPTIONback to summary
public static final int CONSUMER_EXCEPTION

A Consumer service method has thrown an exception.

This WireAdminEvent type indicates that a Consumer service method has thrown an exception. The WireAdminEvent#getThrowable() method will return the exception that the Consumer service method raised.

The value of CONSUMER_EXCEPTION is 0x00000002.

PRODUCER_EXCEPTIONback to summary
public static final int PRODUCER_EXCEPTION

A Producer service method has thrown an exception.

This WireAdminEvent type indicates that a Producer service method has thrown an exception. The WireAdminEvent#getThrowable() method will return the exception that the Producer service method raised.

The value of PRODUCER_EXCEPTION is 0x00000001.

referenceback to summary
private final ServiceReference<WireAdmin> reference

The WireAdmin service which created this event.

throwableback to summary
private final Throwable throwable

Exception associates with this the event.

typeback to summary
private final int type

Type of this event.

See Also
getType()
wireback to summary
private final Wire wire

The Wire object associated with this event.

WIRE_CONNECTEDback to summary
public static final int WIRE_CONNECTED

The WireAdminEvent type that indicates that an existing Wire object has become connected. The Consumer object and the Producer object that are associated with the Wire object have both been registered and the Wire object is connected. See Wire#isConnected() for a description of the connected state. This event may come before the producersConnected and consumersConnected method have returned or called to allow synchronous delivery of the events. Both methods can cause other WireAdminEvent s to take place and requiring this event to be send before these methods are returned would mandate asynchronous delivery.

The value of WIRE_CONNECTED is 0x00000020.

WIRE_CREATEDback to summary
public static final int WIRE_CREATED

A Wire has been created.

This WireAdminEvent type that indicates that a new Wire object has been created. An event is broadcast when WireAdmin#createWire(String, String, java.util.Dictionary) is called. The WireAdminEvent#getWire() method will return the Wire object that has just been created.

The value of WIRE_CREATED is 0x00000004.

WIRE_DELETEDback to summary
public static final int WIRE_DELETED

A Wire has been deleted.

This WireAdminEvent type that indicates that an existing wire has been deleted. An event is broadcast when WireAdmin#deleteWire(Wire) is called with a valid wire. WireAdminEvent#getWire() will return the Wire object that has just been deleted.

The value of WIRE_DELETED is 0x00000010.

WIRE_DISCONNECTEDback to summary
public static final int WIRE_DISCONNECTED

The WireAdminEvent type that indicates that an existing Wire object has become disconnected. The Consumer object or/and Producer object is/are unregistered breaking the connection between the two. See Wire#isConnected for a description of the connected state.

The value of WIRE_DISCONNECTED is 0x00000040.

WIRE_TRACEback to summary
public static final int WIRE_TRACE

The WireAdminEvent type that indicates that a new value is transferred over the Wire object. This event is sent after the Consumer service has been notified by calling the Consumer#updated(Wire, Object) method or the Consumer service requested a new value with the Wire#poll() method. This is an advisory event meaning that when this event is received, another update may already have occurred and this the Wire#getLastValue() method returns a newer value then the value that was communicated for this event.

The value of WIRE_TRACE is 0x00000080.

WIRE_UPDATEDback to summary
public static final int WIRE_UPDATED

A Wire has been updated.

This WireAdminEvent type that indicates that an existing Wire object has been updated with new properties. An event is broadcast when WireAdmin#updateWire(Wire, java.util.Dictionary) is called with a valid wire. The WireAdminEvent#getWire() method will return the Wire object that has just been updated.

The value of WIRE_UPDATED is 0x00000008.

Constructor Detail

WireAdminEventback to summary
public WireAdminEvent(ServiceReference<WireAdmin> reference, int type, Wire wire, Throwable exception)

Constructs a WireAdminEvent object from the given ServiceReference object, event type, Wire object and exception.

Parameters
reference:ServiceReference<WireAdmin>

The ServiceReference object of the Wire Admin service that created this event.

type:int

The event type. See getType().

wire:Wire

The Wire object associated with this event.

exception:Throwable

An exception associated with this event. This may be null if no exception is associated with this event.

Method Detail

getServiceReferenceback to summary
public ServiceReference<WireAdmin> getServiceReference()

Return the ServiceReference object of the Wire Admin service that created this event.

Returns:ServiceReference<WireAdmin>

The ServiceReference object for the Wire Admin service that created this event.

getThrowableback to summary
public Throwable getThrowable()

Returns the exception associated with the event, if any.

Returns:Throwable

An exception or null if no exception is associated with this event.

getTypeback to summary
public int getType()

Return the type of this event.

The type values are:

Returns:int

The type of this event.

getWireback to summary
public Wire getWire()

Return the Wire object associated with this event.

Returns:Wire

The Wire object associated with this event or null when no Wire object is associated with the event.