|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GISFunctionality
The GISFunctionality interface must be implemented by all functionalities of
GISResource
s. It declares basic methods to initialize and cleanup functionalities and
another method to return a reference to the resource that it provides functions for.
It is a common practice to declare sub-interfaces which extend GISFunctionality
to declare methods specific
to a certain GIS task. For example, the MapFunctionality
extends
GISFunctionality
and declares methods required to do basic mapping. Then resources that support basic mapping
provide a class (for example AGSMapFunctionality
,
AIMSMapFunctionality
, etc.) which implements
MapFunctionality
to do mapping.
Once resources have provided classes that implement the various functionalities that the resource supports, users can then select from this laundry list of functionalities to use for a given instance of the resource. Users can add the functionalities to use with a resource instance programmatically as such:
WebContext ctx = ...; AGSMapResource ags1 = new AGSMapResource(); ags1.setEndPointURL("http://myserver/mywebservice"); <b>ags1.addFunctionality("map", new AGSMapFunctionality());</b> ctx.addResource("ags1", ags1, 0);
They can also add functionalities declaratively using JSF managed bean configuration files:
<managed-bean> <managed-bean-name>agsMap</managed-bean-name> <managed-bean-class>com.esri.adf.web.ags.data.AGSMapFunctionality</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>ags1</managed-bean-name> <managed-bean-class>com.esri.adf.web.ags.data.AGSMapResource</managed-bean-class> <managed-bean-scope>none</managed-bean-scope> ... <managed-property> <property-name>functionalities</property-name> ... <map-entries> <map-entry> <key>map</key> <value>#{agsMap}</value> </map-entry> </map-entries> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>myContext</managed-bean-name> <managed-bean-class>com.esri.adf.web.data.WebContext</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> ... <managed-property> <property-name>resources</property-name> ... <map-entries> <map-entry> <key>ags1</key> <value>#{ags1}</value> </map-entry> ... </map-entries> </managed-property> </managed-bean>
Method Summary | |
---|---|
void |
destroyFunctionality()
The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. |
GISResource |
getResource()
Returns the GISResource associated with this functionality. |
void |
initFunctionality(GISResource resource)
The initialization chores for the functionality must be performed in this method. |
Method Detail |
---|
void initFunctionality(GISResource resource)
The initialization chores for the functionality must be performed in this method. This method is called by the
resource
when the functionality needs to be initialized. This happens either when the resource
itself is being initialized or if users add this functionality to the resource using the
GISResource.addFunctionality(String, GISFunctionality)
method after the resource has already
been initialized.
Classes which implement this method should maintain the resource
as a class instance variable and
return the same in the getResource()
method. The functionality is ready for use only after this method has
been called.
resource
- the GISResource
that this functionality supportsGISResource.init(WebContext)
void destroyFunctionality()
The cleanup chores (such as releasing held resources) for the functionality must be performed in this method. This
method is called by the GISResource
when the resource itself is being destroyed.
The functionality is no longer usable after this method has been called.
GISResource.destroy()
GISResource getResource()
Returns the GISResource
associated with this functionality.
The resource passed to initFunctionality(GISResource)
is maintained as a class variable and is accessible
through this method.
GISResource
associated with this functionality
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |