|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.spot.resourcesharing.SimpleResource
public class SimpleResource
A simple implementation of the IResource
interface that can be used as it is, or
extended for a more complex use. By default uses SimpleResourceHandle
: if
an extension needs to use a different IResourceHandle
then it should override
createNewHandle()
.
Constructor Summary | |
---|---|
SimpleResource(String name)
|
Method Summary | |
---|---|
protected IResourceHandle |
createNewHandle()
|
IResourceHandle |
getHandle(ResourceSharingScheme scheme,
boolean isLockedInADifferentIsolate)
Generate a handle for this resource. |
String |
getResourceName()
|
IResourceHandle |
lockAdjusted(IResourceHandle handle,
ResourceSharingScheme oldScheme,
ResourceSharingScheme newScheme)
A previously generated handle is adjusting its ResourceSharingScheme. |
void |
unlocked(IResourceHandle handle)
A previously generated handle has been unlocked, and the handle can be reused. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleResource(String name)
Method Detail |
---|
public IResourceHandle getHandle(ResourceSharingScheme scheme, boolean isLockedInADifferentIsolate) throws ResourceUnavailableException
IResource
getHandle
in interface IResource
scheme
- The scheme that the requestor intends to follow for this handleisLockedInADifferentIsolate
- true if a lock for this resource already exists in another isolate
ResourceUnavailableException
- if, despite the checks already performed by the registry, the
resource still thinks the handle shouldn't be generated because it would conflict with other usagepublic String getResourceName()
getResourceName
in interface IResource
public void unlocked(IResourceHandle handle)
IResource
unlocked
in interface IResource
handle
- The handle that has been unlocked.public IResourceHandle lockAdjusted(IResourceHandle handle, ResourceSharingScheme oldScheme, ResourceSharingScheme newScheme) throws ResourceSharingException, ResourceUnavailableException
IResource
lockAdjusted
in interface IResource
ResourceSharingException
- if the scheme is not supported or there is some other problem
ResourceUnavailableException
- if, despite the checks already performed by the registry, the
resource still thinks the scheme shouldn't be adjusted because it would conflict with other usageprotected IResourceHandle createNewHandle()
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |