There are several ways to get your component to execute.
- Automatic Execution
- The Shell
- owrun
- Programmatically
Automatic Execution
If you marked your components InstallableCompoentDescriptorPolicy
to
run immediately or at
boot time the system will automatically run your component
once it is resolved. The
states of components are discussed in the Packaging section
of the Developing Components tutorial. Run immediately will
cause your component to run right after it is installed and resolved.
Run at boot time will cause your component to execute when the
container manager is started provided the component is resolved.
The Explorer
A discussion of how to run components in the explorer can be
found in Getting
Started or in the Explorer
tutorial trail.
The Shell
Assume Openwings is running, the shell is running and components
have been successfully installed. An
“ls -l” command on the command line of the shell will display
the states of components you have installed. Another short-hand
indication that a component can be executed, is the mark of an
asterisk next to the component name when an “ls” command is entered
on the command line of the shell.
HelloWorldSubscriber_im-0.1 *
You can run your component by using the shell command "process
–start <componentName>". Or you can simply enter the
componentName on the command line of the shell and hit enter.
owrun
Alternatively, you can use owrun.bat/owrun.csh and enter "owrun
<absolute path of the InstallableComponentDescriptorPolicy
for your component>". An example of owrun is shown below:
owrun x:\cots2\HelloWorldProvider_im-0.1\policies\InstallableCmponentDescriptorPolicy.xml
You may want to use the owrun command when you want to observe
information about a component. This can be helpful if you are
designing a separate component, if your component includes
native code or if you are trying to debug a component.
Below is a screen image after using the owrun command on the Image_im
component of Image Service. Codebase and classpath details can
be very helpful.
classpath=x:\cots2\openwings-1.0\lib\gd_openwings.jar
token=x:\cots2\openwings-1.0\lib\gd_openwings.jar
url=file:/x:/cots2/openwings-1.0/lib/gd_openwings.jar
Loaded ComponentPolicy
JAVA EXECUTABLE
PROPERTIES
net.openwings.identity.PropertyFile=file:/x:\cots2/openwings-1.0/policies/properties.txt
CODEBASE
http://AZ25-JP05Q01:8880/gd_openwings_dl.jar
Failed: http://AZ25-JP05Q01:8880/gd_openwings_dl.jar
http://AZ25-JP05Q01:8880/install/ImageService_im/ImageService.jar
Failed: http://AZ25-JP05Q01:8880/install/ImageService_im/ImageService.jar
http://AZ25-JP05Q01:8880/install/ImageUI_im/ImageUI.jar
Failed: http://AZ25-JP05Q01:8880/install/ImageUI_im/ImageUI.jar
http://AZ25-JP05Q01:8880/install/Image_im/Image_cn.jar
Failed: http://AZ25-JP05Q01:8880/install/Image_im/Image_cn.jar
CLASSPATH
file:/x:/cots2/Image_im/policies/
Opened: file:/x:/cots2/Image_im/policies/
file:/x:/cots2/openwings-1.0/policies/
Opened: file:/x:/cots2/openwings-1.0/policies/
file:/x:/cots2/openwings-1.0/lib/gd_openwings.jar
Opened: file:/x:/cots2/openwings-1.0/lib/gd_openwings.jar
file:/x:/cots2/ImageService_im/lib/ImageService.jar
Opened: file:/x:/cots2/ImageService_im/lib/ImageService.jar
file:/x:/cots2/ImageUI_im/lib/ImageUI.jar
Opened: file:/x:/cots2/ImageUI_im/lib/ImageUI.jar
file:/x:/cots2/Image_im/lib/Image_cn.jar
Opened: file:/x:/cots2/Image_im/lib/Image_cn.jar
file:/x:/cots2/Image_im/lib/Image.jar
Opened: file:/x:/cots2/Image_im/lib/Image.jar
LOADING CLASS: com.gd.openwings.demo.image.provider.ImageServiceImpl
PARAMETERS
http://AZ25-JP05Q01:8880/install/Image_im
...
Programmatically
Programmatically you can discovery the ContainerManager and
run a component. The API can be found here.
To discover the ContainerManager you can use code similar to discovering
the installer, shown
here.