|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.omg.PortableServer.Servant
devsBridge.DevsFactoryPOA
genDevs.devsBridge.factory.DevsFactoryBroker
public class DevsFactoryBroker
Implements and Serves a DevsFactory, which delegates creation-requests and release-requests to other factories. Furthermore it implements the call for releasing objects after a certain period of time. TradingService is discovered by initial reference and on fallback at the naming Service for name "TradingService" Currently supports only DevsInit (no Devs and DevsParam) orbd -ORBInitialPort 2809
Field Summary | |
---|---|
protected java.util.GregorianCalendar |
cal
time operations |
protected java.lang.Thread |
clearupThread
the Tread for checking time and releasing models |
protected java.util.Map<devsBridge.Devs,devsBridge.DevsFactory> |
factoryMap
keep track on models and their factories |
protected CosTrading.Lookup |
lookup
interface ot the trading service |
protected ORBHelper.ORBInfo |
orbInfo
references to ORB and POA |
protected java.util.SortedMap<java.util.Date,devsBridge.Devs> |
revTimeOutMap
keep track on scheduled release date and corresponding models |
protected java.util.Map<devsBridge.Devs,java.util.Date> |
timeOutMap
keep track on models and their scheduled release date |
Constructor Summary | |
---|---|
DevsFactoryBroker(ORBHelper.ORBInfo orbInfo)
Constructor. |
Method Summary | |
---|---|
devsBridge.Devs |
constructDevs(java.lang.String modelName,
java.lang.String translatorName,
int timeoutHours)
|
devsBridge.DevsInit |
constructDevsInit(java.lang.String modelName,
java.lang.String translatorName,
int timeoutHours)
|
devsBridge.DevsInit |
constructDevsInitParams(java.lang.String modelName,
java.lang.String translatorName,
int timeoutHours,
java.lang.String params)
|
devsBridge.DevsPorts |
constructDevsPorts(java.lang.String modelName,
java.lang.String translatorName,
int timeoutHours)
|
protected void |
finalize()
|
protected devsBridge.TradingDevsFactory |
getTradedFactory(java.lang.String modelName,
java.lang.String translatorName)
Returns a model that can create models for given Names of the model and the Translator. |
protected void |
insertModel(devsBridge.Devs devs,
devsBridge.DevsFactory devsFactory,
int timeOutHours)
Keeps track on given model. |
static void |
main(java.lang.String[] args)
|
java.lang.String |
ping(java.lang.String testString)
Test if model is reponding. |
void |
releaseModel(devsBridge.Devs devs)
|
protected void |
removeModel(devsBridge.Devs devs)
Calls the corresponding factory to release the model and removes the model from Track-Keeping. |
void |
run()
wakes up every hour and releases expired models |
protected void |
stopRun()
Stops the execution of the class - namely the clearup Thread. |
Methods inherited from class devsBridge.DevsFactoryPOA |
---|
_all_interfaces, _invoke, _this, _this |
Methods inherited from class org.omg.PortableServer.Servant |
---|
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ORBHelper.ORBInfo orbInfo
protected CosTrading.Lookup lookup
protected java.util.Map<devsBridge.Devs,devsBridge.DevsFactory> factoryMap
protected java.util.Map<devsBridge.Devs,java.util.Date> timeOutMap
protected java.util.SortedMap<java.util.Date,devsBridge.Devs> revTimeOutMap
protected java.util.GregorianCalendar cal
protected java.lang.Thread clearupThread
Constructor Detail |
---|
public DevsFactoryBroker(ORBHelper.ORBInfo orbInfo) throws org.omg.CORBA.UserException
orbInfo
- setup of the ORB.
org.omg.CORBA.UserException
- on locating trading service.Method Detail |
---|
protected void stopRun()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected void insertModel(devsBridge.Devs devs, devsBridge.DevsFactory devsFactory, int timeOutHours) throws devsBridge.DevsCorbaException
devs
- the model.devsFactory
- the factory that created the model.timeOutHours
- automatically release the model after this time.
devsBridge.DevsCorbaException
- on any errorprotected void removeModel(devsBridge.Devs devs) throws devsBridge.DevsCorbaException
devs
- the model.
devsBridge.DevsCorbaException
- on any error.public void run()
run
in interface java.lang.Runnable
protected devsBridge.TradingDevsFactory getTradedFactory(java.lang.String modelName, java.lang.String translatorName) throws devsBridge.DevsCorbaException
modelName
- name of the model.translatorName
- name of the translator.
devsBridge.DevsCorbaException
- if no corresponding factory was found.public devsBridge.Devs constructDevs(java.lang.String modelName, java.lang.String translatorName, int timeoutHours) throws devsBridge.DevsCorbaException
constructDevs
in interface devsBridge.DevsFactoryOperations
devsBridge.DevsCorbaException
public devsBridge.DevsPorts constructDevsPorts(java.lang.String modelName, java.lang.String translatorName, int timeoutHours) throws devsBridge.DevsCorbaException
constructDevsPorts
in interface devsBridge.DevsFactoryOperations
devsBridge.DevsCorbaException
public devsBridge.DevsInit constructDevsInitParams(java.lang.String modelName, java.lang.String translatorName, int timeoutHours, java.lang.String params) throws devsBridge.DevsCorbaException
constructDevsInitParams
in interface devsBridge.DevsFactoryOperations
devsBridge.DevsCorbaException
public devsBridge.DevsInit constructDevsInit(java.lang.String modelName, java.lang.String translatorName, int timeoutHours) throws devsBridge.DevsCorbaException
constructDevsInit
in interface devsBridge.DevsFactoryOperations
devsBridge.DevsCorbaException
public void releaseModel(devsBridge.Devs devs) throws devsBridge.DevsCorbaException
releaseModel
in interface devsBridge.DevsFactoryOperations
devsBridge.DevsCorbaException
public static void main(java.lang.String[] args)
args
- arguments to the ORBpublic java.lang.String ping(java.lang.String testString)
ping
in interface devsBridge.PingableOperations
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |