input
stringlengths
10
828
output
stringlengths
5
107
public default bounded range model get default bounded range model return br model
returns the default bounded range model associated with the file
public int get thread id return thread indice
returns the identity mark of the thread associated with the file
private void print use class c method me print writer out class args me get parameter types out print appel de la m thode c get name me get name out flush if args null for int i 0 i args length i out print args i get name if i args length 1 out print out println out flush
this function prints in out which method will be call
public our classpath get classpath return classpath
accessor to the class path
public void key typed key event e char c e get key char key string c system out println key typed char key string system out println key typed code e get key code if c g radius 5 else if c s radius 3 repaint
handle the key typed event from the text field
public void key pressed key event e char c e get key char key string c system out println key pressed char key string system out println key pressed code e get key code repaint
handle the key pressed event from the text field
public void print all employees elist print all employees
print alle employees
public void get statiegeld string name readline system out println magazijn search product name get statiegeld
haal statiegeld op
public void print money box kasgeld print cash
print het kasgeld
public void pay all employees double totalcash 0 array list employee emplist elist get employees for employee e emplist totalcash totalcash e get money system out println u moet totalcash salaris betalen n wilt u de salarissen afschrijven van de kas ja nee if store readline equals ignore case ja kasgeld get cashflow totalcash 0 kasgeld decrease cash totalcash system out println het bedrag is uit de kas gehaald for employee e emplist e reset money elist save else system out println transacties afgebroken controleer uw kas
betaal alle employees
public set get depends on set set new hash set set add core return set
return the set of names of modules that this module depends on
public string get name return module
return the name of the module
public set get depends on set set new hash set set add core set add scanner return set
return the set of names of modules that this module depends on
public void relinquish resources log service get instance scanner log info relinquish resources try if collection in null collection in close if collection out null collection out close catch exception e log service get instance scanner log error relinquish resources e
release the held resource
public void do scan throws scanner exception try string resource list collection in list resources for int i 0 i resource list length i process collection resource list i collection in collection out catch throwable t log service get instance scanner log error do scan t throw new scanner exception error polling the database t
do the scan pull the documents from the jms queue and submit this
public void set document org dom4j document doc string root path throws org dom4j document exception query results root path xml data transform to dom doc column count 1 row count 1 column classes new class get column count column names new string get column count column numbers new hash map
set the data document and clear the cached information
public string get delivery status string packet id if message status null message status new message delivery status if map contains key packet id set delivery status packet id message delivery status not initiated return map get packet id to string
this metod was modified to dont raise a exception
public iconfig info get info if info null info new resource config info this method returns type specific options return comments public collection get type specific options return null return description of this worker return description public string get description return null return the name return public string get name return null return info
get the configuration iformation for this class
public collection get type specific options return null
this method returns type specific options
static public void main string args junit textui test runner run suite
run all the test methods in this class
public void set options iconfig data data get info apply config data data
set the options
public void initialize string connection factory get info get str value q factory name string queue get info get str value q name set up the jms stuff try context new initial context queue connection factory connection factory queue connection factory context lookup connection factory connection connection factory create queue connection queue session connection create queue session false session client acknowledge queue queue context lookup queue catch exception e log service get instance log error e finally try connection close queue session close context close catch exception e log service get instance log error e
setup the options
public void relinquish resources log service get instance log info relinquish resources try connection close queue session close context close catch exception e log service get instance log error relinquish resources e
release the held resource
public void do scan throws scanner exception queue receiver receiver null try create a queue receiver receiver queue session create receiver queue connection start while true message m receiver receive 1 if m null feed document fdoc jms helper get feed document dummy m enqueue fdoc get data fdoc get attributes catch exception e log service get instance log error e finally try receiver close catch exception e log service get instance log error e
do the scan pull the documents from the jms queue and submit this
public ijournal get journal if journal null string journal name get info get str value delegated journal try journal ijournal journal type get journal type journal name get type instance catch service exception e log service get instance log error e return journal
get the delegated journal create if necessary
public topic connection factory get topic connection factory string topic conn factory name throws general exception topic connection factory factory null try if cache contains key topic conn factory name factory topic connection factory cache get topic conn factory name else factory topic connection factory ic lookup topic conn factory name cache put topic conn factory name factory catch naming exception ne throw new general exception ne catch exception e throw new general exception e return factory
this method helps in obtaining the topic factory
public ipipeline stage factory get factory if factory null string factory name get info get str value delegated factory try factory pipeline factory factory get pipeline stage factory factory name catch pipeline exception e log service get instance log error get pipeline stage factory e return factory
get the pipeline stage factory
public topic get topic string topic name throws general exception topic topic null try if cache contains key topic name topic topic cache get topic name else topic topic ic lookup topic name cache put topic name topic catch naming exception ne throw new general exception ne catch exception e throw new general exception e return topic
this method obtains the topc itself for a caller
public data source get data source string data source name throws general exception data source data source null try if cache contains key data source name data source data source cache get data source name else data source data source ic lookup data source name cache put data source name data source catch naming exception ne throw new general exception ne catch exception e throw new general exception e return data source
this method obtains the datasource itself for a caller
public ipipeline stage resolver get resolver return get factory get resolver
get the resolver
public ipipeline stage resolver get resolver try return get ejb factory get resolver catch remote exception re return null
get the resolver
public string get entry stage name throws pipeline exception return get factory get entry stage name
get the entry point into the pipelinestage
public ifeeder get feeder throws general exception if feeder null string feeder name config service get string config file feeder if feeder name null feeder name default feeder feeder feeder factory get instance get feeder feeder name if feeder null feeder initialize get config data return feeder
get the feeder for this mdb
private iconfig data get config data return config data get config data root config file
get the configuration data
public string get pipeline if pipeline null pipeline config service get string config file pipeline return pipeline
get the pipeline name
public void on message message message try get feeder process jms helper get feed document get pipeline message catch general exception e log service get instance log error e catch jmsexception e log service get instance log error e
actually do the processing in response to the reception of a jms message
public void set options iconfig data config data throws pipeline exception get factory set options config data
set the options on this pipeline stage factory
public iconfig info get delegated info return get journal get info
get the configuration information from the delegated object not from
public boolean is stage tracked string stage name throws pipeline exception return get factory is stage tracked stage name
must this pipeline stage track its data object
public iconfig info get info if info null info new journal config info this method returns type specific options return comments public collection get type specific options collection options new array list options add new config option delegated journal journal type null true the journal type of the delegated journal this journal implmentation actually does the work return options return description of this worker return description public string get description return ejb journal intended for journals running inside j2ee containers return the name return public string get name return ejb journal return null
get the configuration iformation for this class
public collection get type specific options collection options new array list options add new config option delegated journal journal type null true the journal type of the delegated journal this journal implmentation actually does the work return options
this method returns type specific options
public void set name string name get factory set name name
set the name of the object
public string get description return ejb journal intended for journals running inside j2ee containers
return description of this worker
public string get name return get factory get name
get the name of the object
public string get name return ejb journal
return the name
public iconfig info get info if info null info new pipeline stage factory info this method returns type specific options return comments public collection get type specific options collection specific new array list specific add new config option delegated factory pipeline factory type null true the name of the pipeline stage factory that will do the processing of the pipeline return specific return description of this worker return description public string get description return pipeline stage factory running inside the ejb factory return the name return public string get name return ejb return info
get the configuration iformation for this class and not the delegated
public string get description return local proxy to the ejb pipeline stage factory
return description of this worker
public collection get type specific options collection specific new array list specific add new config option delegated factory pipeline factory type null true the name of the pipeline stage factory that will do the processing of the pipeline return specific
this method returns type specific options
public string get name return ejb client pipeline stage factory
return the name
public string get description return pipeline stage factory running inside the ejb factory
return description of this worker
public string get description return local proxy to the ejb journal
return description of this worker
public string get name return ejb client journal
return the name
public void set config url string config url throws exception this config url config url if get log is debug enabled get log log debug set config url config url
stop the service mbean
public set get depends on set set new hash set set add core set add sql return set
scanner module only depends on core
public string get config url throws exception if get log is debug enabled get log log debug get config url config url return this config url
get the config url setting
public void start worker scanner worker worker throws scanner exception check if worker with the sam name alread exist scanner thread thread scanner thread get threads remove worker get name if thread null stop this thread thread stop thread worker initialize worker scanner thread new thread new scanner thread worker new thread start get threads put worker get name new thread
start this worker
public void stop all if get threads null get threads key set null for iterator iterator get threads key set iterator iterator has next scanner thread thread scanner thread get threads get iterator next thread stop thread
stop all threads by making the run methods return
public void set babeldoc home string home throws exception system set property babeldoc home home if get log is debug enabled get log log debug set babeldoc home home
set the babeldoc home
public void test is cron schedule type assert equals true worker is cron schedule type
test cron schedule
public string get babeldoc home throws exception string home system get property babeldoc home if get log is debug enabled get log log debug get babeldoc home home return home
get the babeldoc home
public string get state string throws exception if passed first start if get log is debug enabled get log log debug get state string com babeldoc core i18n get state descriptions state return com babeldoc core i18n get state descriptions state else if get log is debug enabled get log log debug get state string state descriptions state return state descriptions state
get the state string
public boolean is time to run calendar calendar calendar get instance calendar set time new date boolean time to run minutes calendar get calendar minute hours calendar get calendar hour of day days calendar get calendar day of month 1 months calendar get calendar month days of week calendar get calendar day of week 1 return time to run
test whether the current schedule is ready to run
public void stop throws exception if scanner null state scanner service state stopped if state scanner service state stopped scanner stop scanner finish up state scanner service state stopped if get log is debug enabled get log log debug com babeldoc core i18n get state descriptions state
start the service mbean
public string to string return new to string builder this append minutes minutes append hours hours append days days append months months append days of week days of week to string
convert to a nice string
public string get service prefix return scanner prefix
get the service prefix
public void run while running worker is counted down wait to run if log service get instance is debug enabled log service get instance log debug this get name scanning if worker is cron schedule type worker process else scanner schedule scan schedule worker get cron schedule if scan schedule null scan schedule is time to run worker process running false paspes log service get instance log debug this get name stopping
perform useful scanning work this is the main method in a thread
public string get description return i18n get scanner null scanner desc
return description of this worker
public void test configure worker throws exception assert null factory configure worker null
test configure worker
public void stop thread running false worker stop interrupt
stop this thread running
public void relinquish resources
release the held resource
protected void initialize throws scanner configuration exception
this method is called when worker is being initialized
public void do scan throws scanner exception byte data new byte 256 try process process runtime get runtime exec application input stream is process get input stream byte array output stream baos new byte array output stream int chars read 0 while chars read is read data 1 baos write data 0 chars read is close baos close if baos size 0 enqueue baos to byte array new name value pair new name value pair application application catch ioexception e throw new scanner exception e
do the scan run the application and capture the standard output from the
public void initialize throws scanner configuration exception get log info initialize application this get info get str value application if application null new file application is file system out println application application throw new scanner configuration exception i18n get scanner external application scanner error application application
setup the options
public void do scan throws scanner exception http method method null method get method if method null header headers method get response headers map attrs new hash map attrs put scan path key url if headers null headers length 0 for int i 0 i headers length i attrs put headers i get name headers i get value try enqueue method get response body attrs catch ioexception ioe log log error scanner http scanner do scan error ioe method release connection
perform the scan
public void do scan throws scanner exception try process vfs queue get queue catch file system exception e todo auto generated catch block e print stack trace
this method will scan for new documents
public void relinquish resources get log info relinquish resources
release the held resource
public void connect and login throws scanner exception try int reply ftp client connect ftp host reply ftp client get reply code if ftpreply is positive completion reply ftp client disconnect throw new scanner exception error connectiong ftp client login ftp username ftp password catch ioexception e if ftp client is connected try ftp client disconnect catch ioexception f do nothing
connect to the ftp server and loging
public void do scan throws scanner exception process directory this get in directory
this method will scan for new documents
public void do scan throws scanner exception try process ftp folder ftp folder catch exception e throw new scanner exception i18n get scanner ftp scanner error general e
do the scan
public string get description return i18n get scanner http scanner description
get the description
public string get name return http scanner
get the name of this scanner worker
public void relinquish resources try ftp client disconnect catch ioexception io ignore
disconnect from the ftp host
public void do scan throws scanner exception get documents from sql
get the documents from the sql
public void relinquish resources fs manager close file system get in directory get file system if done directory null fs manager close file system done directory get file system
release the held resource
private boolean accept file file file check name filter first and then age if accept entry filter filename file get name if get minimum file age get file age file return true else if log is debug enabled log log debug ignoring file get name age get file age file get minimum file age potentially add additional checks here return false
consult configuration if this file should be processed
public void relinquish resources log service get instance log info relinquish resources
release the held resource
private void move file string current ftp file name
move the file to another directory
private long get file age file file return system current time millis new date file last modified get time
get age of file in ms
private connection get connection throws scanner exception try if resource null resource resource factory get resource resource name return connection resource check out catch resource exception re throw new scanner exception i18n get scanner 055 re
get a connection using the resource name
private void process vfs array list al queue throws file system exception iterator it al queue iterator while it has next file object file file object it next if accept file file file filter create scan document and queue it try process file file move file file catch exception ex log log error error getting document from file file get name to string ex
process all files in this directory
public void relinquish resources do nothing by now
release the held resource
private void handle simple documents result set rs throws exception while rs next string contnet rs get object 1 to string enqueue contnet get bytes utf8 new hash map
get simple documents using resultsets
private string buffer get mail content part part throws exception code donated by hans benedict mime type type new mime type part get content type buffered reader reader null string charset type get parameter charset if charset null reader new buffered reader new input stream reader part get input stream charset else reader new buffered reader new input stream reader part get input stream string buffer result new string buffer string line while line reader read line null system out println appending line result append line append n return result
return the mail content from the part
private long get file age file object file throws file system exception return system current time millis file get content get last modified time
get age of file in ms
public scanner worker get worker string worker name throws scanner exception scanner worker worker scanner worker workers get worker name if worker null try to load and initialize iconfig data config get config worker name worker configure worker config workers put worker name worker if worker null throw new scanner exception no worker with the given name else return worker
get scanner worker with name worker name
private void delete message message message throws messaging exception message set flag flags flag deleted true
this method performs deletion of mail message
public void set scanner scanner scanner this scanner scanner
set the scanner
public scanner get scanner return scanner
get child the scanner
private void configure workers workers new hashtable for iterator iterator config data get children name set iterator iterator has next string scanner name string iterator next iconfig data config config data get child scanner name if log is debug enabled log log debug getting configuration config try workers put config get name configure worker config catch exception e log log error i18n get scanner scanner factory error init worker config get name config e
configure and cache all the works
public boolean is cron schedule type return string utils is empty get info get str value scanner worker info scanner cron schedule
return true if this is worker is a cron schedule type