|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelma.framework.core.ApplicationBean
public class ApplicationBean
Application bean that provides a handle to the scripting environment to application specific functionality.
Constructor Summary | |
---|---|
ApplicationBean(Application app)
Creates a new ApplicationBean object. |
Method Summary | |
---|---|
void |
addCronJob(java.lang.String functionName)
Add a cron job that will run once a minute |
void |
addCronJob(java.lang.String functionName,
java.lang.String year,
java.lang.String month,
java.lang.String day,
java.lang.String weekday,
java.lang.String hour,
java.lang.String minute)
Add a cron job that will run at the specified time intervals |
void |
addRepository(java.lang.Object obj)
Add a repository to the app's repository list. |
void |
clearCache()
Clear the application cache. |
int |
countSessions()
Return the number of currently active sessions |
SessionBean |
createSession(java.lang.String sessionID)
Create a new session with the given session id |
void |
debug(java.lang.Object msg)
Log a DEBUG message to the app log if debug is set to true in app.properties. |
void |
debug(java.lang.String logname,
java.lang.Object msg)
Log a DEBUG message to the log defined by logname if debug is set to true in app.properties. |
Application |
get__app__()
|
int |
getActiveThreads()
Get the number of currently active request threads |
INode[] |
getActiveUsers()
Get an array of currently active registered users |
java.lang.String |
getAppDir()
Return the absolute application directory (appdir property in apps.properties file) |
java.util.Map |
getAppsProperties()
Get a wrapper around the app's apps.properties |
int |
getCacheusage()
Returns the number of elements in the NodeManager's cache |
java.lang.String |
getCharset()
Return the app's default charset/encoding. |
java.lang.ClassLoader |
getClassLoader()
Get the app's classloader |
java.util.Map |
getCronJobs()
Returns an read-only map of the custom cron jobs registered with the app |
INode |
getData()
Returns the app's data node used to share data between the app's evaluators |
java.util.Map |
getDbProperties()
Get a wrapper around the app's db properties |
DbSource |
getDbSource(java.lang.String name)
Return a DbSource object for a given name. |
java.lang.String |
getDir()
Returns the absolute path of the app dir. |
long |
getErrorCount()
|
int |
getFreeThreads()
Get the number of currently available threads/request evaluators |
java.lang.String[] |
getGlobalMacroPath()
Get the path for global macro resolution |
org.apache.commons.logging.Log |
getLogger()
Get the app's event logger. |
org.apache.commons.logging.Log |
getLogger(java.lang.String logname)
Get the app logger. |
int |
getMaxThreads()
Get the maximal thread number for this application |
java.util.Map |
getModules()
Returns the app's modules map used to register application modules |
java.lang.String |
getName()
|
java.util.Map |
getProperties()
Get a wrapper around the app's properties |
Prototype |
getPrototype(java.lang.String name)
Get a prototype by name. |
Prototype[] |
getPrototypes()
Get an array of this app's prototypes |
INode[] |
getRegisteredUsers()
Get an array of all registered users |
java.lang.Object[] |
getRepositories()
Returns the app's repository list. |
long |
getRequestCount()
|
java.lang.String |
getServerDir()
Return the absolute server directory |
SessionBean |
getSession(java.lang.String sessionID)
Get a session object for the specified session id |
SessionBean[] |
getSessions()
Get an array of all active sessions |
SessionBean[] |
getSessionsForUser(INode usernode)
Get an array of all currently active sessions for a given user node |
SessionBean[] |
getSessionsForUser(java.lang.String username)
Get an array of all currently active sessions for a given user name |
Skin |
getSkin(java.lang.String protoname,
java.lang.String skinname,
java.lang.Object[] skinpath)
Return a skin for a given object. |
java.util.Map |
getSkinfiles()
Return a map of skin resources |
java.util.Map |
getSkinfilesInPath(java.lang.Object[] skinpath)
Return a map of skin resources including the app-specific skinpath |
java.util.Date |
getUpSince()
|
INode |
getUser(java.lang.String username)
Get a user object with the given name |
long |
getXmlrpcCount()
|
java.lang.Object |
invoke(java.lang.Object thisObject,
java.lang.Object function,
java.lang.Object[] args)
Trigger a synchronous Helma invocation with a default timeout of 30 seconds. |
java.lang.Object |
invoke(java.lang.Object thisObject,
java.lang.Object function,
java.lang.Object[] args,
long timeout)
Trigger a synchronous Helma invocation. |
FutureResult |
invokeAsync(java.lang.Object thisObject,
java.lang.Object function,
java.lang.Object[] args)
Trigger an asynchronous Helma invocation. |
FutureResult |
invokeAsync(java.lang.Object thisObject,
java.lang.Object function,
java.lang.Object[] args,
long timeout)
Trigger an asynchronous Helma invocation. |
void |
log(java.lang.Object msg)
Log a INFO message to the app log. |
void |
log(java.lang.String logname,
java.lang.Object msg)
Log a INFO message to the log defined by logname. |
INode |
registerUser(java.lang.String username,
java.lang.String password)
Register a user with the given name and password using the database mapping of the User prototype |
void |
removeCronJob(java.lang.String functionName)
Unregister a previously registered cron job |
void |
setGlobalMacroPath(java.lang.String[] path)
Set the path for global macro resolution |
void |
setMaxThreads(int n)
Set the maximal thread number for this application |
java.lang.String |
toString()
Return a string presentation of this AppBean |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ApplicationBean(Application app)
app
- ...Method Detail |
---|
public void clearCache()
public org.apache.commons.logging.Log getLogger()
public org.apache.commons.logging.Log getLogger(java.lang.String logname)
logname
.
public void log(java.lang.Object msg)
msg
- the log messagepublic void log(java.lang.String logname, java.lang.Object msg)
logname
- the name (category) of the logmsg
- the log messagepublic void debug(java.lang.Object msg)
msg
- the log messagepublic void debug(java.lang.String logname, java.lang.Object msg)
logname
- the name (category) of the logmsg
- the log messagepublic java.lang.Object[] getRepositories()
public void addRepository(java.lang.Object obj)
obj
- the repository, relative or absolute path to the library.public java.lang.ClassLoader getClassLoader()
public int countSessions()
public SessionBean getSession(java.lang.String sessionID)
sessionID
- the session id
public SessionBean createSession(java.lang.String sessionID)
sessionID
- the session id
public SessionBean[] getSessions()
public INode registerUser(java.lang.String username, java.lang.String password)
username
- the user namepassword
- the user password
public INode getUser(java.lang.String username)
username
- the user name
public INode[] getActiveUsers()
public INode[] getRegisteredUsers()
public SessionBean[] getSessionsForUser(INode usernode)
usernode
- the user node
public SessionBean[] getSessionsForUser(java.lang.String username)
username
- the user node
public void addCronJob(java.lang.String functionName)
functionName
- the function namepublic void addCronJob(java.lang.String functionName, java.lang.String year, java.lang.String month, java.lang.String day, java.lang.String weekday, java.lang.String hour, java.lang.String minute)
functionName
- the function nameyear
- comma separated list of years, or *month
- comma separated list of months, or *day
- comma separated list of days, or *weekday
- comma separated list of weekdays, or *hour
- comma separated list of hours, or *minute
- comma separated list of minutes, or *public void removeCronJob(java.lang.String functionName)
functionName
- the function namepublic java.util.Map getCronJobs()
public int getCacheusage()
public INode getData()
public java.util.Map getModules()
public java.lang.String getDir()
public java.lang.String getName()
public java.util.Date getUpSince()
public long getRequestCount()
public long getXmlrpcCount()
public long getErrorCount()
public Application get__app__()
public java.util.Map getProperties()
public java.util.Map getDbProperties()
public DbSource getDbSource(java.lang.String name)
public java.util.Map getAppsProperties()
public Prototype[] getPrototypes()
public Prototype getPrototype(java.lang.String name)
name
- the prototype name
public int getFreeThreads()
public int getActiveThreads()
public int getMaxThreads()
public void setMaxThreads(int n)
n
- the maximal number of threads/request evaluatorspublic Skin getSkin(java.lang.String protoname, java.lang.String skinname, java.lang.Object[] skinpath)
public java.util.Map getSkinfiles()
public java.util.Map getSkinfilesInPath(java.lang.Object[] skinpath)
skinpath
- an array of directory paths or HopObjects to search for skins
public java.lang.String getAppDir()
public java.lang.String getServerDir()
public java.lang.String getCharset()
public void setGlobalMacroPath(java.lang.String[] path)
path
- an array of global namespaces, or nullpublic java.lang.String[] getGlobalMacroPath()
public java.lang.Object invoke(java.lang.Object thisObject, java.lang.Object function, java.lang.Object[] args) throws java.lang.Exception
thisObject
- the object to invoke the function on,
or null for global invokationfunction
- the function or function name to invokeargs
- an array of arguments
java.lang.Exception
- exception thrown by the functionpublic java.lang.Object invoke(java.lang.Object thisObject, java.lang.Object function, java.lang.Object[] args, long timeout) throws java.lang.Exception
thisObject
- the object to invoke the function on,
or null for global invokationfunction
- the function or function name to invokeargs
- an array of argumentstimeout
- the timeout in milliseconds. After waiting
this long, we will try to interrupt the invocation
java.lang.Exception
- exception thrown by the functionpublic FutureResult invokeAsync(java.lang.Object thisObject, java.lang.Object function, java.lang.Object[] args)
thisObject
- the object to invoke the function on,
or null for global invokationfunction
- the function or function name to invokeargs
- an array of arguments
this long, we will try to interrupt the invocation
public FutureResult invokeAsync(java.lang.Object thisObject, java.lang.Object function, java.lang.Object[] args, long timeout)
thisObject
- the object to invoke the function on,
or null for global invokationfunction
- the function or function name to invokeargs
- an array of argumentstimeout
- the timeout in milliseconds. After waiting
this long, we will try to interrupt the invocation
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |