Java Doc for Job.java in  » J2EE » Expresso » com » jcorporate » expresso » core » job » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Expresso » com.jcorporate.expresso.core.job 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.Thread
      com.jcorporate.expresso.core.registry.ExpressoThread
         com.jcorporate.expresso.core.job.Job

All known Subclasses:   com.jcorporate.expresso.services.job.TestJob,  com.jcorporate.expresso.services.job.ClearOldValidation,  com.jcorporate.expresso.services.job.ValidationJob,  com.jcorporate.expresso.ext.job.SendNotice,  com.jcorporate.expresso.services.job.ControllerJob,
Job
abstract public class Job extends ExpressoThread (Code)
A Job is an asynchronous task who's results will generally be emailed to the user initiating the job. Jobs themselves are executed by JobHandler, and are also capable of getting queued in such a way as to repeatedly execute. Important: from Expresso 5.6, threadlocal datamembers are expected to hold User ID and data context. Therefore, any subclass of Job should set this information at the beginning of run() by calling, in the subclass, super.run(); as the first line of the subclass run() method.
author:
   Michael Nash
See Also:   com.jcorporate.expresso.core.utility.JobHandler
since:
   Expresso 1.0


Field Summary
final public static  StringIS_NOTIFY_ON_JOB_SUCCESS
     Key for if we should notify the user on a successful job.
protected static  Loggerlog
    

Constructor Summary
public  Job()
    

Method Summary
protected  voidaddFunction(String name, String descrip)
     If a job can do more than one distinct function, it registers those functions so that the administration controller can tell the user about them.
public  voidaddParamValidValues(String paramCode, Vector paramValidValues)
     Adds a list of valid values for the particular parmeters.
protected  voidaddParameter(String paramCode, String paramDescrip)
    
protected  voidfinish(String msg)
    
protected  voidfinish(String msg, Throwable t)
    
public  CrontabEntrygetCronAlarmEntry()
    
protected  StringgetDataContext()
    
public  HashtablegetFunctions()
    
public  StringgetJobNumber()
    
protected  StringgetJobParameter(String paramCode)
     Convenience method to get the job parameters one by one as needed.
Parameters:
  paramCode - to retrieve.
protected  ListgetJobParameterList()
    
public  JobQueuegetJobQueueEntry()
    
public  VectorgetParamValidValues(String paramCode)
    
public  StringgetParameterDescription(String paramName)
    
public  HashtablegetParameterNamesAndDescriptions()
    
protected  StringgetSchema(String schemaClass)
    
protected  StringgetString(String stringCode)
     Getstring without any substitution capabilities
Parameters:
  stringCode - the string code.
protected  StringgetString(String stringCode, String arg1)
     Internationalization methods.
protected  StringgetString(String stringCode, String arg1, String arg2)
     Internationalization methods.
protected  StringgetString(String stringCode, String arg1, String arg2, String arg3)
     Internationalization methods.
protected  StringgetString(String stringCode, String arg1, String arg2, String arg3, String arg4)
     Internationalization methods.
protected  StringgetString(String stringCode, Object[] args)
     Pass on a call to retrieve an appropriate localized string from the correct Schema object.
public  StringgetTitle()
     Retrieve the title of the job.
public  StringgetUser()
    
protected  booleanhasParameters()
    
public static synchronized  Jobinstantiate(String className)
    
public  booleanmultiThreaded()
     Implementors of this class must override this to return true if they are multi-threaded, e.g.
public  voidrun()
    
protected synchronized  voidsendMail(String subject, String myRecipients, Vector mailMessage)
    
public  voidsetCronAlarmEntry(CrontabEntry obj)
    
public synchronized  voidsetQueue(JobQueue newJobQueue)
     Set the JobQueue object that created this job.
protected  voidsetSchema(String schemaClass)
     Tell this Job object what Schema it belongs to.
public  voidsetUseCron(boolean useCron)
    
public  booleanuseCron()
    

Field Detail
IS_NOTIFY_ON_JOB_SUCCESS
final public static String IS_NOTIFY_ON_JOB_SUCCESS(Code)
Key for if we should notify the user on a successful job.



log
protected static Logger log(Code)
The log4j Logger




Constructor Detail
Job
public Job()(Code)
Default Constructor




Method Detail
addFunction
protected void addFunction(String name, String descrip)(Code)
If a job can do more than one distinct function, it registers those functions so that the administration controller can tell the user about them.
Parameters:
  name - the name of the function
Parameters:
  descrip - the function description



addParamValidValues
public void addParamValidValues(String paramCode, Vector paramValidValues)(Code)
Adds a list of valid values for the particular parmeters. Will be automatically be picked up by the controller that generically launches any jobs.
Parameters:
  paramCode - the parameter code
Parameters:
  paramValidValues - Vector of valid value objects



addParameter
protected void addParameter(String paramCode, String paramDescrip)(Code)
Add a parameter
Parameters:
  paramCode - the actual parameter code, similar to the parametercode for a controller.
Parameters:
  paramDescrip - The "user friendly" name of the description.



finish
protected void finish(String msg)(Code)
Finish up the Job, clearing the job queue entry, sending a completion email, flush the queues, etc
Parameters:
  msg - the message to send to the queuing user



finish
protected void finish(String msg, Throwable t)(Code)
Finish up the Job, clearing the job queue entry, sending a completion email, flush the queues, etc
Parameters:
  msg - the message to send to the queuing user
Parameters:
  t - The Exception to log in the message



getCronAlarmEntry
public CrontabEntry getCronAlarmEntry()(Code)
Retrieve the cron alarm entry Object



getDataContext
protected String getDataContext() throws DBException(Code)
Retrieve the data context of the job java.lang.String



getFunctions
public Hashtable getFunctions()(Code)
Retrieve the functions the Job Handler can execute Hashtable



getJobNumber
public String getJobNumber()(Code)
Return the jobnumber of this job String



getJobParameter
protected String getJobParameter(String paramCode) throws DBException(Code)
Convenience method to get the job parameters one by one as needed.
Parameters:
  paramCode - to retrieve. The string of the param value, or null if no such named parameterexists.
throws:
  DBException - if there's an error reading the values.



getJobParameterList
protected List getJobParameterList() throws DBException(Code)
Returns a List of the parameters given to the job A List of the parameters or null if there are no parametersfor the job.
throws:
  DBException - upon error



getJobQueueEntry
public JobQueue getJobQueueEntry() throws DBException(Code)
Return the job queue entry that caused this job to begin JobQueue A JobQueue object
throws:
  DBException - If the object cannot be returned



getParamValidValues
public Vector getParamValidValues(String paramCode)(Code)
Retrieve all valid values for the given parameter
Parameters:
  paramCode - the parameter name a vector of valid value objects



getParameterDescription
public String getParameterDescription(String paramName)(Code)
Get the value of a specified parameter
Parameters:
  paramName - the parameter name java.lang.String the parameter value or null



getParameterNamesAndDescriptions
public Hashtable getParameterNamesAndDescriptions()(Code)
Retreive all parameters hashtable of parameters



getSchema
protected String getSchema(String schemaClass) throws ServerException(Code)
Instantiate & return the schema class given in the current parameter BUG BUG: This function isn't right, what was the intention: -MR
Parameters:
  schemaClass - the schema class to set A Schema object instantiated from the class named by the'SchemaClass' parameter



getString
protected String getString(String stringCode)(Code)
Getstring without any substitution capabilities
Parameters:
  stringCode - the string code. java.lang.String
See Also:   com.jcorporate.expresso.core.i18n.Messages.getString



getString
protected String getString(String stringCode, String arg1)(Code)
Internationalization methods.
Parameters:
  stringCode - the string code to look up in the messages bundle
Parameters:
  arg1 - Formatting argument java.lang.String the expanded value
throws:
  IllegalArgumentException - if the stringCode cannot be found inthe schema's message bundle.
See Also:   com.jcorporate.expresso.core.i18n.Messages.getString



getString
protected String getString(String stringCode, String arg1, String arg2)(Code)
Internationalization methods.
Parameters:
  stringCode - the string code to look up in the messages bundle
Parameters:
  arg1 - Formatting argument
Parameters:
  arg2 - Formatting argument java.lang.String the expanded value
throws:
  IllegalArgumentException - if the stringCode cannot be found inthe schema's message bundle.
See Also:   com.jcorporate.expresso.core.i18n.Messages.getString



getString
protected String getString(String stringCode, String arg1, String arg2, String arg3)(Code)
Internationalization methods.
Parameters:
  stringCode - the string code to look up in the messages bundle
Parameters:
  arg1 - Formatting argument
Parameters:
  arg2 - Formatting argument
Parameters:
  arg3 - Formatting argument java.lang.String the expanded value
throws:
  IllegalArgumentException - if the stringCode cannot be found inthe schema's message bundle.
See Also:   com.jcorporate.expresso.core.i18n.Messages.getString



getString
protected String getString(String stringCode, String arg1, String arg2, String arg3, String arg4)(Code)
Internationalization methods.
Parameters:
  stringCode - the string code to look up in the messages bundle
Parameters:
  arg1 - Formatting argument
Parameters:
  arg2 - Formatting argument
Parameters:
  arg3 - Formatting argument
Parameters:
  arg4 - Formatting argument java.lang.String the expanded value
throws:
  IllegalArgumentException - if the stringCode cannot be found inthe schema's message bundle.
See Also:   com.jcorporate.expresso.core.i18n.Messages.getString



getString
protected String getString(String stringCode, Object[] args)(Code)
Pass on a call to retrieve an appropriate localized string from the correct Schema object. This is a convenience method that can be used within Job objects to save having to build a long call to the static methods in the Messages object.
Parameters:
  stringCode - the string code to look up in the messages bundle
Parameters:
  args - the formatting object array java.lang.String the expanded value
throws:
  IllegalArgumentException - if the stringCode cannot be found inthe schema's message bundle.



getTitle
public String getTitle()(Code)
Retrieve the title of the job. Override in your own job for a descriptive entry java.lang.String



getUser
public String getUser()(Code)
Return the username who requested this job String



hasParameters
protected boolean hasParameters() throws DBException(Code)
Does this job have parameters? true if it does.
throws:
  DBException - upon error



instantiate
public static synchronized Job instantiate(String className) throws ServerException(Code)
Convenience method to create a Job from it's name
Parameters:
  className - the classname to instantiate an instantiated Job
throws:
  ServerException - upon instantiation error



multiThreaded
public boolean multiThreaded()(Code)
Implementors of this class must override this to return true if they are multi-threaded, e.g. can be run at the same time as other jobs. boolean True if this job can be run in parallel with other jobs



run
public void run()(Code)
Implement the actual logic for this server object



sendMail
protected synchronized void sendMail(String subject, String myRecipients, Vector mailMessage)(Code)
Send an e-mail message to a list of recipients
Parameters:
  subject - Subject of the message
Parameters:
  myRecipients - Recipients of the message
Parameters:
  mailMessage - Contents of the message, as strings in a vector



setCronAlarmEntry
public void setCronAlarmEntry(CrontabEntry obj)(Code)
Sets the cron alarm entry
Parameters:
  obj - the cron alarm entry



setQueue
public synchronized void setQueue(JobQueue newJobQueue)(Code)
Set the JobQueue object that created this job. Called by the server when the job is launched, so we have this information available.
Parameters:
  newJobQueue - JobQueue object that triggered this job



setSchema
protected void setSchema(String schemaClass)(Code)
Tell this Job object what Schema it belongs to. This is used when the Job tries to use it's "getString(String, Object[])" method to prepare internationalized messages - it passes the call along to the appropriate schema which knows how to locate the proper message file.
Parameters:
  schemaClass - the schema class name



setUseCron
public void setUseCron(boolean useCron)(Code)
If a job will be executed in cron process - say it
Parameters:
  useCron - true if this job will be executed in cron process



useCron
public boolean useCron()(Code)
Should we use Crontab? true if set



Methods inherited from com.jcorporate.expresso.core.registry.ExpressoThread
protected ExpressoThreadContext getThreadContext()(Code)(Java Doc)
public void run()(Code)(Java Doc)

Fields inherited from java.lang.Thread
final public static int MAX_PRIORITY(Code)(Java Doc)
final public static int MIN_PRIORITY(Code)(Java Doc)
final public static int NORM_PRIORITY(Code)(Java Doc)

Methods inherited from java.lang.Thread
public static int activeCount()(Code)(Java Doc)
final public void checkAccess()(Code)(Java Doc)
native public int countStackFrames()(Code)(Java Doc)
native public static Thread currentThread()(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
public static void dumpStack()(Code)(Java Doc)
public static int enumerate(Thread tarray)(Code)(Java Doc)
public static Map<Thread, StackTraceElement[]> getAllStackTraces()(Code)(Java Doc)
public ClassLoader getContextClassLoader()(Code)(Java Doc)
public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler()(Code)(Java Doc)
public long getId()(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
final public int getPriority()(Code)(Java Doc)
public StackTraceElement[] getStackTrace()(Code)(Java Doc)
public State getState()(Code)(Java Doc)
final public ThreadGroup getThreadGroup()(Code)(Java Doc)
public UncaughtExceptionHandler getUncaughtExceptionHandler()(Code)(Java Doc)
native public static boolean holdsLock(Object obj)(Code)(Java Doc)
public void interrupt()(Code)(Java Doc)
public static boolean interrupted()(Code)(Java Doc)
final native public boolean isAlive()(Code)(Java Doc)
final public boolean isDaemon()(Code)(Java Doc)
public boolean isInterrupted()(Code)(Java Doc)
final public synchronized void join(long millis) throws InterruptedException(Code)(Java Doc)
final public synchronized void join(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void join() throws InterruptedException(Code)(Java Doc)
final public void resume()(Code)(Java Doc)
public void run()(Code)(Java Doc)
public void setContextClassLoader(ClassLoader cl)(Code)(Java Doc)
final public void setDaemon(boolean on)(Code)(Java Doc)
public static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
final public void setName(String name)(Code)(Java Doc)
final public void setPriority(int newPriority)(Code)(Java Doc)
public void setUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
native public static void sleep(long millis) throws InterruptedException(Code)(Java Doc)
public static void sleep(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
public synchronized void start()(Code)(Java Doc)
final public void stop()(Code)(Java Doc)
final public synchronized void stop(Throwable obj)(Code)(Java Doc)
final public void suspend()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
native public static void yield()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.