All Examples This Package
Class examples.t3client.StartupQuery
java.lang.Object
|
+----examples.t3client.StartupQuery
- public class StartupQuery
- extends Object
- implements T3ServletDef, T3StartupDef
The StartupQuery example illustrates three different facets of the
WebLogic Server architecture:
- Startup classes are automatically loaded
and executed when the WebLogic Server starts up. You can use startup
classes to perform functions that need to run when a
WebLogic-based application is launched. In this example we
perform JDBC queries that will be used to populate listboxes
on GUI.
- Workspaces are hierarchical storage areas in
WebLogic that can be shared among WebLogic components,
such as WebLogic Event services action and evaluate methods, WebLogic
Remote T3Servlets, and T3Startup classes. In this example, we use a
Workspace to store the results of a JDBC query.
- T3Servlets are methods that can be invoked by
T3Clients within the WebLogic Server. In this example, we use a
T3Servlet to retrieve the results of the JDBC query from the
Workspace.
This example requres a Cloudscape database instance. You'll need to
register this class as a startup class in your weblogic.properties
file, as detailed in the description of the startup()
method.
-
StartupQuery()
-
-
declareParams(ParamSet)
- This method implements the WebLogic T3Servlet interface.
-
execute(ParamSet)
- This method implements the WebLogic T3Servlet interface.
-
setServices(T3ServicesDef)
- This method implements the WebLogic T3Servlet interface.
-
startup(String, Hashtable)
- The startup() method is called at WebLogic startup,
as a result of placing the following lines in the
weblogic.properties file:
weblogic.system.startupClass.doquery=examples.t3client.StartupQuery
weblogic.system.startupArgs.doquery=\
query=select * from emp,\
db=jdbc:weblogic:pool:demoPool
where "db" is the URL of your database pool that
contains a table that you include in the arg "query".
StartupQuery
public StartupQuery()
startup
public String startup(String name,
Hashtable args) throws Exception
- The startup() method is called at WebLogic startup,
as a result of placing the following lines in the
weblogic.properties file:
weblogic.system.startupClass.doquery=examples.t3client.StartupQuery
weblogic.system.startupArgs.doquery=\
query=select * from emp,\
db=jdbc:weblogic:pool:demoPool
where "db" is the URL of your database pool that
contains a table that you include in the arg "query".
When startup is invoked as a result of these two lines, the
"name" argument will be "doquery" (from the left-hand of the
property), and the args hashtable will contain the name-value
pair "query", "select * from emp".
setServices
public void setServices(T3ServicesDef services)
- This method implements the WebLogic T3Servlet interface.
The setServices() method is called to pass to the
T3Servlet the handle of an object that can be used to access WebLogic
services. This makes another reference to the services object so
it can be used later.
- Parameters:
- services - Services stub
declareParams
public void declareParams(ParamSet ps) throws ParamSetException
- This method implements the WebLogic T3Servlet interface.
The declareParams() method is called to specify the
parameters that this T3Servlet will accept. WebLogic
calls this method when the server-side object is
instantiated.
- Parameters:
- ps - ParamSet
- Throws: ParamSetException
- if there is an error in the ParamSet
execute
public void execute(ParamSet ps) throws Exception
- This method implements the WebLogic T3Servlet interface.
The execute() method is called when the client
requests the invocation of this servlet. the ParamSet
contains the arguments for the execute() method.
- Parameters:
- ps - ParamSet
- Throws: Exception
- if there is an error in execution
All Examples This Package