Package jason.infra.jade
Class RunJadeMAS
java.lang.Object
javax.management.NotificationBroadcasterSupport
jason.infra.local.BaseLocalMAS
jason.infra.local.RunLocalMAS
jason.infra.jade.RunJadeMAS
- All Implemented Interfaces:
RunLocalMASMBean
,javax.management.NotificationBroadcaster
,javax.management.NotificationEmitter
public class RunJadeMAS extends RunLocalMAS
Runs MASProject using JADE infrastructure.
This class reads the mas2j project and create the
corresponding agents.
- Author:
- Jomi
-
Nested Class Summary
Nested classes/interfaces inherited from class jason.infra.local.RunLocalMAS
RunLocalMAS.LocalAgArchSynchronousScheduled
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,jade.wrapper.AgentController>
ags
private jade.wrapper.ContainerController
cc
static java.lang.String
controllerName
private jade.wrapper.AgentController
crtc
private jade.wrapper.AgentController
envc
static java.lang.String
environmentName
private java.util.ArrayList<java.lang.String>
initArgs
private static java.util.logging.Logger
logger
private jade.core.ProfileImpl
profile
private java.lang.String
targetContainer
Fields inherited from class jason.infra.local.RunLocalMAS
createdAgents, isRunning, isRunningFinish
Fields inherited from class jason.infra.local.BaseLocalMAS
appFromClassPath, control, debug, defaultProjectFileName, dfAg, env, logPropFile, project, runner, stopMASFileName
-
Constructor Summary
Constructors Constructor Description RunJadeMAS()
-
Method Summary
Modifier and Type Method Description void
addInitArgs(java.lang.String[] args)
void
create()
create environment, agents, controllervoid
createAgs()
void
createButtons()
void
createController()
void
createEnvironment()
void
finish()
int
init(java.lang.String[] args)
protected boolean
isFileName(java.lang.String arg)
Test if an argument actually references a file.static void
main(java.lang.String[] args)
protected java.lang.String[]
prepareArgs(java.lang.String[] args)
Transform original style boot arguments to new form.void
startAgs()
boolean
startContainer()
Methods inherited from class jason.infra.local.RunLocalMAS
changeToDebugMode, createNewReplAgButton, createPauseButton, createReplAg, createStopButton, enableDebugControl, finish, getDefaultLogProperties, hasDebugControl, isRunning, killAg, parseArgs, registerMBean, setupDefaultConsoleLogger, setupLogger, setupLogger, start, startSyncMode, stopAgs, waitEnd
Methods inherited from class jason.infra.local.BaseLocalMAS
addAg, delAg, dfAgExists, dfDeRegister, dfRegister, dfSearch, dfSubscribe, getAg, getAgs, getControllerInfraTier, getDF, getDFAg, getDFAgArch, getEnvironmentInfraTier, getNbAgents, getProject, getRunner, getRuntimeServices, getSubscribers, getWP, isDebug, sendProvider, setProject, setRuntimeServives
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jason.infra.local.RunLocalMASMBean
getNbAgents
-
Field Details
-
controllerName
public static java.lang.String controllerName -
environmentName
public static java.lang.String environmentName -
logger
private static java.util.logging.Logger logger -
envc
private jade.wrapper.AgentController envc -
crtc
private jade.wrapper.AgentController crtc -
ags
private java.util.Map<java.lang.String,jade.wrapper.AgentController> ags -
cc
private jade.wrapper.ContainerController cc -
targetContainer
private java.lang.String targetContainer -
initArgs
private java.util.ArrayList<java.lang.String> initArgs -
profile
private jade.core.ProfileImpl profile
-
-
Constructor Details
-
RunJadeMAS
public RunJadeMAS()
-
-
Method Details
-
main
- Throws:
JasonException
-
init
public int init(java.lang.String[] args)- Overrides:
init
in classRunLocalMAS
-
create
Description copied from class:RunLocalMAS
create environment, agents, controller- Overrides:
create
in classRunLocalMAS
- Throws:
JasonException
-
addInitArgs
public void addInitArgs(java.lang.String[] args) -
createButtons
public void createButtons()- Overrides:
createButtons
in classRunLocalMAS
-
startContainer
public boolean startContainer() -
createEnvironment
- Overrides:
createEnvironment
in classRunLocalMAS
- Throws:
JasonException
-
createController
- Overrides:
createController
in classRunLocalMAS
- Throws:
JasonException
-
createAgs
- Overrides:
createAgs
in classRunLocalMAS
- Throws:
JasonException
-
startAgs
public void startAgs()- Overrides:
startAgs
in classRunLocalMAS
-
finish
public void finish()- Overrides:
finish
in classBaseLocalMAS
-
prepareArgs
protected java.lang.String[] prepareArgs(java.lang.String[] args)Transform original style boot arguments to new form.In the following 'x' and 'y' denote arbitrary strings; 'n' an integer. Transformation Rules: Original New ------------------------------ -host x host:x -owner x owner:x -name x name:x -port n port:n -mtp x mtp:x -aclcodec:x aclcodec:x -conf x import:x -conf -conf -container -container -gui -gui -version -version -v -version -help -help -h -help -nomtp -nomtp -nomobility -nomobility -y x y:x agent list agents:agent list
If the arguments contain either import:x or agents:x we will assume that the arguments are already in the new format and leave them alone. For "import:" we test if what follows is a file name and in the event it isn't we assume that it was if there are any other "-x" options following.You can't mix the old form with the new as this would make the distinction between foo:bar as meaning a property named foo with a value bar or an agent named foo implmented by class bar impossible.
- Parameters:
args
- The command line arguments.
-
isFileName
protected boolean isFileName(java.lang.String arg)Test if an argument actually references a file.- Parameters:
arg
- The argument to test.- Returns:
- True if it does, false otherwise.
-