|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.omg.PortableServer.Servant
devsBridge.TradingDevsFactoryPOA
genDevs.devsBridge.factory.DevsFactoryServer
public class DevsFactoryServer
Base JAVA implementation for a TradingDevsFactory (a DevsFactory that can be registered by a Trading Service). It does not implement the automatic model release after the scheduled time. Note, that it registers no models with the Trading Service. Descendants must overwrite method availableModels. Extend this class by createModelInstance, createTranslatorInstance, availableModels and availableTranslators orbd -ORBInitialPort 2809
Field Summary | |
---|---|
protected java.lang.String |
offerId
Trading service key of this factory |
protected java.lang.Class |
orbClass
reuse the Class object of ORB |
protected ORBHelper.ORBInfo |
orbInfo
references to ORB and POA |
protected java.util.Map<devsBridge.Devs,java.util.Date> |
timeOutMap
keep track of the models and the time they are created |
Constructor Summary | |
---|---|
DevsFactoryServer(ORBHelper.ORBInfo orbInfo)
Constructor. |
Method Summary | |
---|---|
int |
activeModelsCnt()
|
java.lang.String[] |
availableModels()
|
java.lang.String[] |
availableTranslators()
|
devsBridge.Devs |
constructDevs(java.lang.String modelName,
java.lang.String translatorName,
int timeoutHours)
|
devsBridge.DevsInit |
constructDevsInit(java.lang.Object instance,
MessageTranslator trans,
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 java.lang.Object |
createInstance(java.lang.String modelName)
Return an instance of given model name. |
protected MessageTranslator |
createTranslator(java.lang.String translatorName)
Return an instance of given translator name. |
org.omg.CORBA.Any |
evalDP(java.lang.String name,
org.omg.CORBA.TypeCode returned_type,
org.omg.CORBA.Any extra_info)
|
protected void |
finalize()
|
protected java.util.Date |
insertModel(devsBridge.Devs devs,
int timeOutHours)
Keeps track of the created model and informs trading service of changed active model count. |
protected static void |
invokeFactory(ORBHelper.ORBInfo orbInfo,
DevsFactoryServer impl,
java.lang.String factoryName,
java.lang.String[] args)
Starts the given implementation of a DevsFactoryServer within given orbInfo and given command line arguments. |
static void |
main(java.lang.String[] args)
|
java.lang.String |
ping(java.lang.String testString)
|
void |
releaseModel(devsBridge.Devs devs)
|
protected void |
removeModel(devsBridge.Devs devs)
Remove the model from track keeping and inform TradingService of decreased active model count. |
void |
setOfferId(java.lang.String offerId)
setter for the Trading key. |
void |
stopFactory()
removes the service from TradingFactory |
Methods inherited from class devsBridge.TradingDevsFactoryPOA |
---|
_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 java.lang.Class orbClass
protected java.util.Map<devsBridge.Devs,java.util.Date> timeOutMap
protected java.lang.String offerId
Constructor Detail |
---|
public DevsFactoryServer(ORBHelper.ORBInfo orbInfo) throws org.omg.CORBA.UserException
orbInfo
- ORB references.
org.omg.CORBA.UserException
- on any exception.Method Detail |
---|
public void setOfferId(java.lang.String offerId)
offerId
- the trading key.protected java.util.Date insertModel(devsBridge.Devs devs, int timeOutHours)
devs
- the Model to keep Track oftimeOutHours
- a time after what to delete the model
protected void removeModel(devsBridge.Devs devs)
devs
- public void stopFactory() throws org.omg.CORBA.UserException
org.omg.CORBA.UserException
- on errorprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected java.lang.Object createInstance(java.lang.String modelName) throws devsBridge.DevsCorbaException
modelName
- name of the model to create.
devsBridge.DevsCorbaException
protected MessageTranslator createTranslator(java.lang.String translatorName) throws devsBridge.DevsCorbaException
translatorName
- name of the translator
devsBridge.DevsCorbaException
- if no corresponding translator can be created.public devsBridge.Devs constructDevs(java.lang.String modelName, java.lang.String translatorName, int timeoutHours) throws devsBridge.DevsCorbaException
devsBridge.DevsCorbaException
public devsBridge.DevsPorts constructDevsPorts(java.lang.String modelName, java.lang.String translatorName, int timeoutHours) throws devsBridge.DevsCorbaException
devsBridge.DevsCorbaException
public devsBridge.DevsInit constructDevsInitParams(java.lang.String modelName, java.lang.String translatorName, int timeoutHours, java.lang.String params) throws devsBridge.DevsCorbaException
devsBridge.DevsCorbaException
public devsBridge.DevsInit constructDevsInit(java.lang.String modelName, java.lang.String translatorName, int timeoutHours) throws devsBridge.DevsCorbaException
devsBridge.DevsCorbaException
public devsBridge.DevsInit constructDevsInit(java.lang.Object instance, MessageTranslator trans, int timeoutHours) throws devsBridge.DevsCorbaException
devsBridge.DevsCorbaException
public void releaseModel(devsBridge.Devs devs) throws devsBridge.DevsCorbaException
devsBridge.DevsCorbaException
public java.lang.String[] availableTranslators()
public java.lang.String[] availableModels()
public int activeModelsCnt()
public java.lang.String ping(java.lang.String testString)
public org.omg.CORBA.Any evalDP(java.lang.String name, org.omg.CORBA.TypeCode returned_type, org.omg.CORBA.Any extra_info) throws CosTradingDynamic.DPEvalFailure
CosTradingDynamic.DPEvalFailure
protected static void invokeFactory(ORBHelper.ORBInfo orbInfo, DevsFactoryServer impl, java.lang.String factoryName, java.lang.String[] args) throws org.omg.CORBA.UserException
orbInfo
- The ORB and POA to use to create the Corba Object.impl
- The instance of the Server.factoryName
- The name of the factory (just for printing status information)args
- command line arguments
org.omg.CORBA.UserException
- if startup of the server fails.public static void main(java.lang.String[] args)
args
- arguments to the ORB
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |