com.guiseframework.platform.web
Class AbstractWebPlatform

java.lang.Object
  extended by com.guiseframework.platform.AbstractPlatform
      extended by com.guiseframework.platform.web.AbstractWebPlatform
All Implemented Interfaces:
Platform, WebPlatform
Direct Known Subclasses:
HTTPServletWebPlatform

public abstract class AbstractWebPlatform
extends AbstractPlatform
implements WebPlatform

An abstract implementation of a web platform for Guise. This class registers no depictors.

Author:
Garret Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.guiseframework.platform.web.WebPlatform
WebPlatform.PollCommand
 
Field Summary
static int DEFAULT_POLL_INTERVAL
          The default polling interval in milleseconds.
protected static java.lang.String DEPICT_ID_STRING_PREFIX
          The prefix used for creating depict ID strings on this platform.
 
Fields inherited from interface com.guiseframework.platform.web.WebPlatform
AJAX_JAVASCRIPT_PATH, ATTRIBUTE_ATTRIBUTE_HASH, ATTRIBUTE_CLASS_CONTENT, ATTRIBUTE_CONTENT_HASH, ATTRIBUTE_CONTENT_TYPE, ATTRIBUTE_PATCH_TYPE, ATTRIBUTE_PATCH_TYPE_NO_VALUE, ATTRIBUTE_PATCH_TYPE_NONE, ATTRIBUTE_PATCH_TYPE_TEMP, BLANK_MP3_PATH, DOM_JAVASCRIPT_PATH, ELEMENT_IMG_ATTRIBUTE_ORIGINAL_SRC, ELEMENT_IMG_ATTRIBUTE_ROLLOVER_SRC, ELEMENT_TEXTAREA_ATTRIBUTE_MULTILINE, GUISE_AJAX_REQUEST_CONTENT_TYPE, GUISE_AJAX_RESPONSE_CONTENT_TYPE, GUISE_DTD_PATH, GUISE_EMPTY_HTML_DOCUMENT_PATH, GUISE_FLASH_PATH, GUISE_JAVASCRIPT_PATH, GUISE_ML_NAMESPACE_PREFIX, GUISE_ML_NAMESPACE_URI, GUISE_SESSION_UUID_URI_QUERY_PARAMETER, GUISE_VERSION_URI_QUERY_PARAMETER, GUISE_XHTML_DTD_PUBLIC_ID, JAVASCRIPT_JAVASCRIPT_PATH
 
Constructor Summary
AbstractWebPlatform(GuiseApplication application)
          Application.
 
Method Summary
 boolean discontinuePollInterval(DepictedObject depictedObject)
          Indicates that a depicted object no longer requests a particular polling interval.
 long getDepictID(java.lang.String depictIDString)
          Returns the depicted object ID represented by the given platform-specific ID string.
 java.lang.String getDepictIDString(long depictID)
          Generates an ID for the given depicted object appropriate for using on the platform.
 Environment getEnvironment()
           
 int getPollInterval()
           
 java.util.Queue<WebPlatformMessage> getSendMessageQueue()
           
 boolean requestPollInterval(DepictedObject depictedObject, int pollInterval)
          Requests a polling interval for a given depicted object.
 void setPollInterval(int newPollInterval)
          Sets the polling interval in millseconds.
 
Methods inherited from class com.guiseframework.platform.AbstractPlatform
generateDepictID, getApplication, getDepictedObject, getDepictLock, getDepictor, getDepictorClass, getRegisteredDepictorClass, registerDepictedObject, registerDepictorClass, unregisterDepictedObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.guiseframework.platform.web.WebPlatform
getClientProduct, getDepictContext
 
Methods inherited from interface com.guiseframework.platform.Platform
generateDepictID, getApplication, getDepictedObject, getDepictLock, getDepictor, registerDepictedObject, selectPlatformFiles, sendResource, sendResource, sendResource, sendResource, unregisterDepictedObject
 

Field Detail

DEPICT_ID_STRING_PREFIX

protected static final java.lang.String DEPICT_ID_STRING_PREFIX
The prefix used for creating depict ID strings on this platform.

See Also:
Constant Field Values

DEFAULT_POLL_INTERVAL

public static final int DEFAULT_POLL_INTERVAL
The default polling interval in milleseconds.

See Also:
Constant Field Values
Constructor Detail

AbstractWebPlatform

public AbstractWebPlatform(GuiseApplication application)
Application. This version copies the current application environment to a new environment for this platform.

Parameters:
application - The Guise application running on this platform.
Throws:
java.lang.NullPointerException - if the given application is null.
Method Detail

getEnvironment

public Environment getEnvironment()
Specified by:
getEnvironment in interface Platform
Returns:
The user local environment.

getSendMessageQueue

public java.util.Queue<WebPlatformMessage> getSendMessageQueue()
Specified by:
getSendMessageQueue in interface Platform
Specified by:
getSendMessageQueue in interface WebPlatform
Overrides:
getSendMessageQueue in class AbstractPlatform
Returns:
The thread-safe queue of messages to be delivered to the platform.

getPollInterval

public int getPollInterval()
Specified by:
getPollInterval in interface WebPlatform
Returns:
The current polling interval in milleseconds.

setPollInterval

public void setPollInterval(int newPollInterval)
Sets the polling interval in millseconds.

Specified by:
setPollInterval in interface WebPlatform
Parameters:
newPollInterval - The polling interval in millseconds.
Throws:
java.lang.IllegalArgumentException - if the given polling interval is less than zero.

requestPollInterval

public boolean requestPollInterval(DepictedObject depictedObject,
                                   int pollInterval)
Requests a polling interval for a given depicted object. The actual polling interval will be updated if the given polling interval is smaller than the current actual polling interval.

Specified by:
requestPollInterval in interface WebPlatform
Parameters:
depictedObject - The depicted object requesting a polling interval.
pollInterval - The polling interval in milleseconds.
Returns:
true if the polling interval changed as a result of this request.
Throws:
java.lang.NullPointerException - if the given depicted object is null.
java.lang.IllegalArgumentException - if the value is less than zero.
See Also:
discontinuePollInterval(DepictedObject), getPollInterval(), #setPollInterval()

discontinuePollInterval

public boolean discontinuePollInterval(DepictedObject depictedObject)
Indicates that a depicted object no longer requests a particular polling interval. The actual polling interval will be updated if the relinquished poll interval is less than or equal to the current poll interval.

Specified by:
discontinuePollInterval in interface WebPlatform
Parameters:
depictedObject - The depicted object that is relinquishing a polling interval.
Returns:
true if the polling interval changed as a result of this relinquishment.
Throws:
java.lang.NullPointerException - if the given depicted object is null.
See Also:
requestPollInterval(DepictedObject, int), getPollInterval(), #setPollInterval()

getDepictIDString

public java.lang.String getDepictIDString(long depictID)
Generates an ID for the given depicted object appropriate for using on the platform.

Specified by:
getDepictIDString in interface WebPlatform
Parameters:
depictID - The depict ID to be converted to a platform ID.
Returns:
The form of the depict ID appropriate for using on the platform.

getDepictID

public long getDepictID(java.lang.String depictIDString)
Returns the depicted object ID represented by the given platform-specific ID string.

Specified by:
getDepictID in interface WebPlatform
Parameters:
depictIDString - The platform-specific form of the depict ID.
depictID - The depict ID to be converted to a platform ID.
Returns:
The depict ID the platform-specific form represents.
Throws:
java.lang.NullPointerException - if the given string is null.
java.lang.IllegalArgumentException - if the given string does not represent the correct string form of a depict ID on this platform.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.