obixserver.module
Class AbstractBaseModule

java.lang.Object
  extended by obixserver.module.AbstractBaseModule
All Implemented Interfaces:
Service, Module
Direct Known Subclasses:
CoreModule, NoopModule, PushSimulatorModule, SimulatorModule

public abstract class AbstractBaseModule
extends Object
implements Module

This is the abstract base class modules usually extend. It implements most functionality that is common for all modules.


Field Summary
private  String base
          Leaf of the base URL of the module.
private  obix.Obj baseObj
          Base Obj of this module.
private  ObjBroker objBroker
          ObjBroker for module access.
private  String objResource
          Resource to load this modules Obj tree from.
protected  Properties properties
          Properties configured during load that can be read during initialization and execution of the module.
 
Constructor Summary
AbstractBaseModule()
           
AbstractBaseModule(String base)
           
 
Method Summary
 String getBase()
          Return base for this module.
 obix.Obj getBaseObj()
           
 ObjBroker getObjBroker()
          Returns ObjBroker.
 String getObjResource()
          Returns obj resource for auto-loading.
protected  String getProperty(String name)
           
 void init(obix.Obj parent)
          Initialize the module.
protected  obix.Obj loadObjFromResource(obix.Obj parent)
          Utility function: loads resources from an XML file, using module settings such as ObjResource and base.
 void setBase(String base)
          Sets base for this module - this is the leaf of the href of the base Obj of the module.
 void setBaseObj(obix.Obj baseObj)
           
 void setObjBroker(ObjBroker objBroker)
          Sets ObjBroker.
 void setObjResource(String objResource)
          Sets resource for auto-loading of Objs into repository.
 void setProperty(String name, String value)
          Sets property for this module.
 void term()
          De-initialize/terminate the module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface obixserver.core.Service
start, stop
 

Field Detail

properties

protected Properties properties
Properties configured during load that can be read during initialization and execution of the module.


objBroker

private ObjBroker objBroker
ObjBroker for module access.


base

private String base
Leaf of the base URL of the module.


baseObj

private obix.Obj baseObj
Base Obj of this module. All module's Objs are decendents of this Obj.


objResource

private String objResource
Resource to load this modules Obj tree from.

Constructor Detail

AbstractBaseModule

public AbstractBaseModule()

AbstractBaseModule

public AbstractBaseModule(String base)
Method Detail

getObjResource

public String getObjResource()
Description copied from interface: Module
Returns obj resource for auto-loading.

Specified by:
getObjResource in interface Module

setObjResource

public void setObjResource(String objResource)
Description copied from interface: Module
Sets resource for auto-loading of Objs into repository. The resource is an XML file containing Obj tree for the module.

Specified by:
setObjResource in interface Module

getBase

public String getBase()
Description copied from interface: Module
Return base for this module.

Specified by:
getBase in interface Module

setBase

public void setBase(String base)
Description copied from interface: Module
Sets base for this module - this is the leaf of the href of the base Obj of the module. All objects are created as children of this URL.

Specified by:
setBase in interface Module

init

public void init(obix.Obj parent)
Description copied from interface: Module
Initialize the module. Resource will be allocated, etc.

Specified by:
init in interface Module
Parameters:
parent - TODO

loadObjFromResource

protected obix.Obj loadObjFromResource(obix.Obj parent)
Utility function: loads resources from an XML file, using module settings such as ObjResource and base.


term

public void term()
Description copied from interface: Module
De-initialize/terminate the module. Resource will be de-allocated, any second phase cleanup that couldn't be done in stop will be done.

Specified by:
term in interface Module

getObjBroker

public ObjBroker getObjBroker()
Description copied from interface: Module
Returns ObjBroker.

Specified by:
getObjBroker in interface Module

setObjBroker

public void setObjBroker(ObjBroker objBroker)
Description copied from interface: Module
Sets ObjBroker. Used only by the entity that loads the module (Obix server engine).

Specified by:
setObjBroker in interface Module

getBaseObj

public obix.Obj getBaseObj()

setBaseObj

public void setBaseObj(obix.Obj baseObj)

setProperty

public void setProperty(String name,
                        String value)
Description copied from interface: Module
Sets property for this module. Property is a short-named replica of property read from configuration file.

Specified by:
setProperty in interface Module

getProperty

protected String getProperty(String name)


Copyright © 2006-2008 Peter Michalek All Rights Reserved.