public class ResourceContextEvent extends Object
ResourceContextListener.notify(ResourceContextEvent)
method.
A Resource Context Event has a type among the four following ones:
RESOURCE_CONTEXT_CREATED
– A new Resource Context instance has
been created.RESOURCE_CONTEXT_REMOVED
– A Resource Context instance has been
deleted.BUNDLE_ADDED
– A bundle has been added in the scope of a
Resource Context instance.BUNDLE_REMOVED
– A bundle has been removed from the scope of a
Resource Context instance.Modifier and Type | Field and Description |
---|---|
static int |
BUNDLE_ADDED
A bundle has been added to e
ResourceContext |
static int |
BUNDLE_REMOVED
A bundle has been removed from a
ResourceContext |
static int |
RESOURCE_CONTEXT_CREATED
A new
ResourceContext has been created. |
static int |
RESOURCE_CONTEXT_REMOVED
A
ResourceContext has been removed |
Constructor and Description |
---|
ResourceContextEvent(int pType,
ResourceContext pResourceContext)
Create a new ResourceContextEvent.
|
ResourceContextEvent(int pType,
ResourceContext pResourceContext,
long pBundleId)
Create a new ResourceContextEvent.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object var0) |
long |
getBundleId()
Retrieves the identifier of the bundle being added to or removed from the
Resource Context.
|
ResourceContext |
getContext()
Retrieves the Resource Context associated to this event
|
int |
getType()
Retrieves the type of this Resource Context Event.
|
int |
hashCode() |
String |
toString() |
public static final int RESOURCE_CONTEXT_CREATED
ResourceContext
has been created.
The
ResourceMonitoringService.createContext(String, ResourceContext)
method has been invoked.
public static final int RESOURCE_CONTEXT_REMOVED
ResourceContext
has been removed
The ResourceContext.removeContext(ResourceContext)
method has
been invoked
public static final int BUNDLE_ADDED
ResourceContext
The ResourceContext.addBundle(long)
method has been invoked
public static final int BUNDLE_REMOVED
ResourceContext
ResourceContext.removeBundle(long)
method or
ResourceContext.removeBundle(long, ResourceContext)
method have
been invoked, or the bundle has been uninstalled
public ResourceContextEvent(int pType, ResourceContext pResourceContext)
RESOURCE_CONTEXT_CREATED
or
RESOURCE_CONTEXT_REMOVED
.pType
- event typepResourceContext
- contextpublic ResourceContextEvent(int pType, ResourceContext pResourceContext, long pBundleId)
BUNDLE_ADDED
or
BUNDLE_REMOVED
.pType
- event typepResourceContext
- contextpBundleId
- bundlepublic int getType()
public ResourceContext getContext()
public long getBundleId()
Retrieves the identifier of the bundle being added to or removed from the Resource Context.
This method returns a valid value only when getType()
returns:
Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0