Package io.guise.framework.platform
Class AbstractPlatform
java.lang.Object
io.guise.framework.platform.AbstractPlatform
- All Implemented Interfaces:
Platform
- Direct Known Subclasses:
AbstractWebPlatform
The platform on which Guise objects are being depicted.
- Author:
- Garret Wilson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Generates a new depict ID unique to this session platform.getDepictedObject
(long depictedObjectID) Retrieves a depicted object that has been registered with the platform by the ID of the depicted object.<O extends DepictedObject>
Depictor<? super O>getDepictor
(O depictedObject) Determines the depictor appropriate for the given depicted object.protected <O extends DepictedObject>
Class<? extends Depictor<? super O>>getDepictorClass
(Class<O> depictedObjectClass) Determines the depictor class appropriate for the given depicted object class.protected <O extends DepictedObject>
Class<? extends Depictor<? super O>>getRegisteredDepictorClass
(Class<? extends DepictedObject> depictedObjectClass) Determines the depictor class registered for the given depicted object class.Queue<? extends PlatformMessage>
void
registerDepictedObject
(DepictedObject depictedObject) Registers a depicted object so that it can interact with the platform.protected <O extends DepictedObject>
Class<? extends Depictor<? super O>>registerDepictorClass
(Class<O> depictedObjectClass, Class<?> depictorClass) Registers the class of a depictor to depict an object of the given class (and by default subclasses).void
unregisterDepictedObject
(DepictedObject depictedObject) Unregisters a depicted object so that no longer interacts with the platform.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.guise.framework.platform.Platform
getClientProduct, getDepictContext, getEnvironment, selectPlatformFiles, sendResource, sendResource, sendResource, sendResource
-
Constructor Details
-
AbstractPlatform
Application constructor.- Parameters:
application
- The Guise application running on this platform.- Throws:
NullPointerException
- if the given application and/or environment isnull
.
-
-
Method Details
-
getApplication
- Specified by:
getApplication
in interfacePlatform
- Returns:
- The Guise application running on this platform.
-
getDepictLock
- Specified by:
getDepictLock
in interfacePlatform
- Returns:
- The lock used for exclusive depiction on the platform.
-
registerDepictorClass
protected <O extends DepictedObject> Class<? extends Depictor<? super O>> registerDepictorClass(Class<O> depictedObjectClass, Class<?> depictorClass) Registers the class of a depictor to depict an object of the given class (and by default subclasses).- Type Parameters:
O
- The type of registered depicted object class.- Parameters:
depictedObjectClass
- The class of the depicted object for which the depictor should be registered.depictorClass
- The class of depictor to use for depicting the objects.- Returns:
- The depictor class previously registered with the given depicted object class, or
null
if there was no previous registration.
-
getRegisteredDepictorClass
protected <O extends DepictedObject> Class<? extends Depictor<? super O>> getRegisteredDepictorClass(Class<? extends DepictedObject> depictedObjectClass) Determines the depictor class registered for the given depicted object class.- Type Parameters:
O
- The type of registered depicted object class.- Parameters:
depictedObjectClass
- The class of depicted object that may be registered.- Returns:
- The class of depictor registered to depict object of the specific class, or
null
if no depictor is registered.
-
getDepictorClass
protected <O extends DepictedObject> Class<? extends Depictor<? super O>> getDepictorClass(Class<O> depictedObjectClass) Determines the depictor class appropriate for the given depicted object class. A depicted class is located by individually looking up the depicted object class hierarchy for registered depictors.- Type Parameters:
O
- The type of registered depicted object class.- Parameters:
depictedObjectClass
- The class of depicted object for which a depictor should be returned.- Returns:
- A class of depictor for the given depicted object class, or
null
if no depictor is registered.
-
getDepictor
Description copied from interface:Platform
Determines the depictor appropriate for the given depicted object. A depictor class is located by individually looking up the depicted object class hiearchy for registered depictor classes.- Specified by:
getDepictor
in interfacePlatform
- Type Parameters:
O
- The type of depicted object.- Parameters:
depictedObject
- The depicted object for which a depictor should be returned.- Returns:
- A depictor to depict the given component, or
null
if no depictor is registered.
-
registerDepictedObject
Description copied from interface:Platform
Registers a depicted object so that it can interact with the platform.- Specified by:
registerDepictedObject
in interfacePlatform
- Parameters:
depictedObject
- The depicted object to register.
-
unregisterDepictedObject
Description copied from interface:Platform
Unregisters a depicted object so that no longer interacts with the platform.- Specified by:
unregisterDepictedObject
in interfacePlatform
- Parameters:
depictedObject
- The depicted object to unregister.
-
getDepictedObject
Description copied from interface:Platform
Retrieves a depicted object that has been registered with the platform by the ID of the depicted object.- Specified by:
getDepictedObject
in interfacePlatform
- Parameters:
depictedObjectID
- The ID of the depicted object to retrieve.- Returns:
- The registered depicted object with the given ID, or
null
if there is no depicted object registered with this platform with the given ID.
-
generateDepictID
public long generateDepictID()Description copied from interface:Platform
Generates a new depict ID unique to this session platform.- Specified by:
generateDepictID
in interfacePlatform
- Returns:
- A new depict ID unique to this session platform.
-
getSendMessageQueue
- Specified by:
getSendMessageQueue
in interfacePlatform
- Returns:
- The thread-safe queue of messages to be delivered to the platform.
-