org.gcube.common.core.plugins
Class GCUBEPluginContext

java.lang.Object
  extended by org.gcube.common.core.plugins.GCUBEPluginContext

public abstract class GCUBEPluginContext
extends Object

Partial implementation of the main entry point to the functionality and information included in plugins.

GCUBEPluginContext exposes information that is common across all services. This includes:

Individual services may subclass it to introduce additional requirements on the contexts of their plugins. Typically, they add properties and type mappings in their constructors to make the information readily available to both service and clients.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
 class GCUBEPluginContext.TypeMapping
          Groups the information required to to serialise and deserialise a Java class.
 
Constructor Summary
GCUBEPluginContext()
           
 
Method Summary
protected  void addProperty(DescriptiveProperty... properties)
          Adds one or more descriptive properties for the plugin.
protected  void addTypeMappings(GCUBEPluginContext.TypeMapping... mappings)
          Adds one or more type mappings required by the plugin, if any.
 GCUBEService getPlugin()
          Returns the GCUBEService that models the plugin.
 Map<String,DescriptiveProperty> getProperties()
          Returns (a read-only copy of) the descriptive properties of the plugin.
 List<GCUBEPluginContext.TypeMapping> getTypeMappings()
          Returns (a read-only copy of) the type mappings required by the plugin, if any.
 void initialise(GCUBEService plugin)
          Creates an instance for a given plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GCUBEPluginContext

public GCUBEPluginContext()
Method Detail

initialise

public void initialise(GCUBEService plugin)
Creates an instance for a given plugin.

Parameters:
plugin - the plugin.

getPlugin

public GCUBEService getPlugin()
Returns the GCUBEService that models the plugin.

Returns:
the name.

getProperties

public Map<String,DescriptiveProperty> getProperties()
Returns (a read-only copy of) the descriptive properties of the plugin.

Returns:
the properties.

addProperty

protected void addProperty(DescriptiveProperty... properties)
Adds one or more descriptive properties for the plugin.

Parameters:
properties - the property.

getTypeMappings

public List<GCUBEPluginContext.TypeMapping> getTypeMappings()
Returns (a read-only copy of) the type mappings required by the plugin, if any.

Returns:
the type mappings.

addTypeMappings

protected void addTypeMappings(GCUBEPluginContext.TypeMapping... mappings)
Adds one or more type mappings required by the plugin, if any.

Parameters:
mappings - the type mappings.


Copyright © 2013. All Rights Reserved.