input
stringlengths
10
828
output
stringlengths
5
107
public void action performed action event e log view4 jevent event new log view4 jevent log view4 jevent id delete events above log view4 jlogging event log event log table get instance get log event log table get instance get selected row event set log view4 jevent key logging event log event log view4 jevent manager get instance fire event event
fired whe this action is invoked
private void init put client property options no content border key boolean true
initializes the tabbed panel
public void execute runnable runnable try pool execute runnable catch interrupted exception e e print stack trace
executes the runnable using a thread from the pool
public void shut down pool shutdown now
tells the pool to stop executing and not to hand out
public void event received log view4 jevent event paused boolean event get log view4 jevent key paused boolean value
fired when the system is paused or unpaused
public void run read data
reads a logging event from the socket
protected void read data object input stream in null try in new object input stream socket get input stream while true logging event logging event logging event in read object log view4 jlogging event event new log view4 jlogging event logging event logging event null fire event event catch eofexception e catch socket exception s catch throwable t t print stack trace try to close the input stream and socket close in close socket null out the input stream and the socket in null socket null
reads the data from the socket
protected void close object input stream in if in null try in close catch ioexception e e print stack trace
closes the input stream
private string get icon name switch level case priority debug int return icons 0 case priority info int return icons 1 case priority warn int return icons 2 case priority error int return icons 3 case priority fatal int return icons 4 return null
extract a reference to the static icon name
protected void close socket if socket null try socket close catch ioexception e e print stack trace
closes the client socket
protected void fire event log view4 jlogging event logging event event queue put logging event
fires the event
public string get level string switch level case priority debug int return levels 0 case priority info int return levels 1 case priority warn int return levels 2 case priority error int return levels 3 case priority fatal int return levels 4 return null
extract a reference to the static level strings
protected void start accepting thread thread new thread this thread set daemon true thread set priority thread norm priority 1 thread start
starts a new thread to accept connections
public void run while true try socket socket server socket accept socket processor processor new socket processor socket log view4 jthread manager get instance execute processor catch ioexception e todo log this exception formally e print stack trace
continually accepts connection on the server socket
public string get formatted string if formatted string null string buffer buffer new string buffer buffer append level append get level string append n buffer append when append date format format new date when append n buffer append from append get category append n n buffer append message append n if get stack trace present buffer append n throwable append stack trace 0 append n for int i 1 i stack trace length i buffer append stack trace i append n formatted string buffer to string buffer set length 0 buffer null return formatted string
fetch a cached formatted string
public void harvest quick filter items list text to match text to match add get category text to match add get message if get stack trace present for int i 0 i stack trace length i text to match add stack trace i
harvest the quick filter match items
protected void fire event list events log view4 jevent event new log view4 jevent log view4 jevent id logging events received event set log view4 jevent key logging events events log view4 jevent manager get instance fire event event
fires the event
public void toggle marker marked marked
toggles the marker on this log event
public void read throws ioexception system out println dwg file read executed set dwg version if dwg version equals r13 dwg reader new dwg file v14 reader dwg reader read this else if dwg version equals r14 dwg reader new dwg file v14 reader dwg reader read this else if dwg version equals r15 dwg reader new dwg file v15 reader dwg reader read this else if dwg version equals unknown system out println error dwg version not supported
reads a dwg file and put its objects in the dwg objects vector
public void read dwg file dwg file throws ioexception
reads all the dwg format versions
public void read dwg block v15 int data int offset throws exception int bit pos offset bit pos read object header v15 data bit pos vector v dwg util get text string data bit pos bit pos integer v get 0 int value string text string v get 1 name text bit pos read object tail v15 data bit pos
read a block in the dwg format version 15
public void initialize layer table layer table new vector for int i 0 i dwg objects size i dwg object obj dwg object dwg objects get i if obj instanceof dwg layer vector layer table record new vector layer table record add new integer obj get handle layer table record add dwg layer obj get name layer table record add new integer dwg layer obj get color layer table add layer table record
initialize a new vector that contains the dwg file layers
public int get color by layer dwg object entity int color by layer 0 int layer entity get layer handle for int j 0 j layer table size j vector layer table record vector layer table get j int l handle integer layer table record get 0 int value if l handle layer color by layer integer layer table record get 2 int value return color by layer
returns the color of the layer of a dwg object
public void add dwg section offset string key int seek int size dwg section offset dso new dwg section offset key seek size dwg section offsets add dso
add a dwg section offset to the dwg section offsets vector
public void read dwg seqend v15 int data int offset throws exception int bit pos offset bit pos read object header v15 data bit pos bit pos read object tail v15 data bit pos
read a seqend in the dwg format version 15
public int get dwg section offset string key int offset 0 for int i 0 i dwg section offsets size i dwg section offset dso dwg section offset dwg section offsets get i string ikey dso get key if key equals ikey offset dso get seek break return offset
returns the offset of dwg section given by its key
public void add dwg object offset int handle int offset dwg object offset doo new dwg object offset handle offset dwg object offsets add doo
add a dwg object offset to the dwg object offsets vector
public void add dwg class dwg class dwg class system out println dwg file add dwg class executed dwg classes add dwg class
add a dwg class to the dwg classes vector
public void read dwg layer control v15 int data int offset throws exception
read a layer control in the dwg format version 15
public void read dwg endblk v15 int data int offset throws exception int bit pos offset bit pos read object header v15 data bit pos bit pos read object tail v15 data bit pos
read a endblk in the dwg format version 15
public void add object dwg object object this objects add object
add a dwg object to the block objects vector
public sim sync get simsync return simsync
returns the simsync instance used by this application
private void handle exception final throwable t synchronized exceptions exceptions add t
handle an exception
public long get total waiting time return total waiting time
returns the total time this member spent waiting for other members
public boolean is full return capacity members size
returns true if the group reached his expected number of members
static public void main string an arg array junit swingui test runner run suite
main method for running the junit x ui
static public test suite test suite suite new test suite test package test suite suite add test test jaba research car rental service car rental agent impl car rental agent bean test class suite add test test jaba research car rental service reservation agent impl reservation agent bean test class return suite
creates a suite of test cases
static public test suite test suite suite new test suite test package test suite suite add test test jaba research car rental business customer impl test customer ejb class return suite
creates a suite of test cases
public void test get car type state holder car type state holder c type un known null car type state holder c type known csh eco try context initial new initial context car type home c type home car type home portable remote object narrow initial lookup car type bean car type home class string cpk new string 1 car type c un known c type home find by primary key cpk c type un known c un known get car type state holder assert c type known equals c type un known catch exception e e print stack trace
tests the customer state holder
static public test suite test suite suite new test suite test package test suite suite add test test jaba research car rental business car type impl test car type ejb class suite add test test jaba research car rental business customer impl test customer ejb class suite add test test jaba research car rental business reservation impl reservation bean test class return suite
creates a suite of test cases
static public test suite test suite suite new test suite test package test suite suite add test test jaba research car rental business reservation impl reservation bean test class return suite
creates a suite of test cases
static public test suite test suite suite new test suite test package test suite suite add test test jaba research car rental service reservation agent impl reservation agent bean test class return suite
creates a suite of test cases
public map get constraints return constraints
p this will return constraints found within the document
private void parse schema throws ioexception create builder to generate jdom representation of xml schema without validation and using apache xerces xxx allow validation and allow alternate parsers saxbuilder builder new saxbuilder try document schema doc builder build schema url handle attributes list attributes schema doc get root element get children attribute schema namespace for iterator i attributes iterator i has next iterate and handle element attribute element i next handle attribute attribute handle attributes nested within complex types catch jdomexception e throw new ioexception problems occurred e get message
p this will do the work of parsing the schema
public void set min inclusive double min inclusive this min inclusive min inclusive
p this will set the minimum allowed value for this data type inclusive
public double get min inclusive return min inclusive
p this will return the minimum allowed value for this data type inclusive
public customer state holder get customer state holder person person new person name aname new name this get name address aaddress new ukaddress this get address this get address person set name aname person set address aaddress customer state holder csh new customer state holder person this get card no this get version return csh
returns a customer state holder value object containing all customer attributes
public void set min exclusive double min exclusive this min exclusive min exclusive
p this will set the minimum allowed value for this data type exclusive
public double get min exclusive return min exclusive
p this will return the minimum allowed value for this data type exclusive
public void set card no string card no this card no card no
setters and getters for the card number
public customer state holder get customer state holder return new customer state holder this get person card no version
returns the value object for the customer
public void set max inclusive double max inclusive this max inclusive max inclusive
p this will set the maximum allowed value for this data type inclusive
public string set reservation reservation state holder reservation throws ejbexception string res id null system set property java naming factory initial org jnp interfaces naming context factory system set property java naming provider url localhost 1099 try context initial new initial context reservation home res home reservation home portable remote object narrow initial lookup reservation bean reservation home class res id get unique res no re setting the reservation number here reservation set reservation number res id reservation r res home create reservation catch exception e e print stack trace return res id
sets a reservation
public void set car type state holder car type state holder sh throws ejbexception set daily rate sh get daily rate set hourly rate sh get hourly rate set weekly rate sh get weekly rate set number sh get number set pk sh getpk
sets the car type state holder attribute of the car type bean object
public void set entity context entity context context throws ejbexception ctx context
sets the entity context attribute of the car type bean object
public double get max inclusive return max inclusive
p this will return the maximum allowed value for this data type inclusive
public car type state holder get car type state holder throws ejbexception car type state holder c typesh new car type state holder this get pk this get hourly rate this get daily rate this get weekly rate this get number return c typesh
gets the car type state holder attribute of the car type bean object
public boolean equals object ob if ob instanceof car type state holder return false return true
check for car type state holder object
public void unset entity context throws ejbexception ctx null
description of the method
public void set hourly rate string hourly rate this hourly rate hourly rate
set hourly rate value
public void set daily rate string daily rate this daily rate daily rate
set hourly rate value
public void remove customer string custname throws ejbexception system set property java naming factory initial org jnp interfaces naming context factory system set property java naming provider url localhost 1099 try context initialb new initial context customer home cus home customer home portable remote object narrow initialb lookup customer bean customer home class customer remote customer cus home find by primary key custname customer remove catch exception e e print stack trace
removes the customer with the given name
public void set max exclusive double max exclusive this max exclusive max exclusive
p this will set the maximum allowed value for this data type exclusive
public string ping throws ejbexception date format long time stamp date format get date time instance date format full date format full return ping back at you long time stamp format new date
check to see if the server is active
public double get max exclusive return max exclusive
p this will return the maximum allowed value for this data type exclusive
public string ejb create reservation state holder rsh throws javax ejb create exception set reservation state holder rsh system err print hello1 return null
creates a reservation
public string get reservation number return reservation number
gets the reseravtion number
public string ejb create car type state holder sh throws create exception ejbexception sqlexception set car type state holder sh return null
description of the method
public reservation state holder get reservation state holder return new reservation state holder get reservation number get start date get end date get car type get customer name
returns the state holder object associated with this reservation
public void set reservation number string reservation number this reservation number reservation number
sets the resercvation number
public void set reservation state holder reservation state holder rsh set reservation number rsh get reservation number set start date rsh get start date set end date rsh get end date set car type rsh get car type set customer name rsh get customer name
sets up a state holder containing details of the reservation
public void ejb post create car type state holder sh throws create exception ejbexception sqlexception
description of the method
public car type ejb find by primary key string pk throws finder exception ejbexception write your code here return null
description of the method
public list get allowed values return allowed values
p this will return the list of allowed values for this data type
public void set car type string car type this car type car type
sets the car type
public void set max length double max length this max length max length
p this will set the maximum allowed length for this data type
public boolean equals object ob if ob instanceof reservation state holder return false reservation state holder rsh reservation state holder ob return rsh get reservation number equals this get reservation number rsh get start date equals this get start date rsh get end date equals this get end date rsh get car type equals this get car type rsh get customer name equals this get customer name
overridden equals for junit testing purposes
public double get max length return max length
p this will return the maximum allowed length for this data type
public boolean has max length return new double max length is na n
p this will return code true code if a maximum length constraint exists
public void set min length double min length this min length min length
p this will set the minimum allowed length for this data type
public double get min length return min length
p this will return the minimum allowed length for this data type
public boolean has min length return new double min length is na n
p this will return code true code if a minimum length constraint exists
public void set reservation number string reservation number system out println setting reservation number this reservation number reservation number
sets the resercvation number
public void ejb activate throws java rmi remote exception
ejb activate method comment
public string get path info if path null return if req null return req get path info return
this emulates the hack needed to allow producer from file to work
public void set customer system set property java naming factory initial org jnp interfaces naming context factory system set property java naming provider url localhost 1099 try context initial new initial context reservation agent home res agent home reservation agent home portable remote object narrow initial lookup reservation agent bean reservation agent home class reservation agent reservation agent res agent home create reservation agent set customer this create customer state holder catch exception e system out print test error e print stack trace
calls set customer on the reservation agent facade
public buffered reader get reader throws ioexception if document null return new buffered reader new string reader document if req null return req get reader return null
this will return the reader for the wrapper
public enumeration get parameter names if req null params size 0 vector names new vector enumeration req names req get parameter names while req names has more elements names add element req names next element req names params keys while req names has more elements names add element req names next element return params elements if req null return req get parameter names if params size 0 return params keys return null
this will return all the parameter names in the http servlet request object
public string get parameter string name if params contains key name return string params get name 0 if req null string value req get parameter name if value null return value if document null name equals ignore case producer return org apache cocoon producer producer from request return null
this will return a parameter value for a given name
public void set end date string new end date end date new end date
sets the end date
public void set car type string new car type car type new car type
sets the car type
public void set customer name string new customer name customer name new customer name
sets the customer name
public void test class1 add the code for testing class1 here assert true tests the method com valtech bootcamp car rental web customer class1 get property
tests the method com
public void test get property add the code for testing get property here assert true tests the method com valtech bootcamp car rental web customer class1 set property
tests the method com
public void test set property add the code for testing set property here assert true tests the method com valtech bootcamp car rental web customer class1 get property1
tests the method com
public void test get property1 add the code for testing get property1 here assert true tests the method com valtech bootcamp car rental web customer class1 set property1
tests the method com
public void test set property1 add the code for testing set property1 here assert true tests the method com valtech bootcamp car rental web customer class1 get property2
tests the method com
public void test get property2 add the code for testing get property2 here assert true tests the method com valtech bootcamp car rental web customer class1 set property2
tests the method com
public void test set property2 add the code for testing set property2 here assert true
tests the method com
public void set weekly rate string weekly rate this weekly rate weekly rate
sets the weekly rate attribute of the rent car jb object