How do I wait for a module to be ready

A common mistake is to not make the difference between

the status of the Common Agent Container and the status of modules deployed inside.

As any container, CAC may be in good shape while modules deployed aren't.

The command "cacaoadm status" gives you the status of the container but

to get the actual state and status of a module the command is cacaoadm status <module name>.

The container may be in three states:

  • stopped
# cacaoadm status
default instance is DISABLED at system startup. 
default instance is not running.
  • started
# cacaoadm status
default instance is DISABLED at system startup.
Smf monitoring process:
13400
Uptime: 0 day(s), 0:16
  • starting
# cacaoadm status
default instance is DISABLED at system startup.
Daemon is running but not available. Try again as it might be starting."

The container may be still starting executing its own initilization phase but mainly busy to

start modules deployed inside. see here for details. The container is ready to serve as soon as

an uptime is printed.

All this as nothing to do with the satus of a modules deployed. The container will start a module but

the module can be actually not ready to serve :

  • The module's creation (deployment) may have fail because of missing jars or imcompatible platform.
  • The module may have not been started because of dependency problem.
  • The module may have not been started because its is locked by default
  • The module may have failed to start because of an error raised during its initialization.
  • etc...

If an application depends on a service(s) deployed in CAC (i.e a module(s)) . This application

must monitor the status of the module it is interested in and not the container itself.

This is done by "cacaoadm status <module name>".

Few examples of module'state/status :

  • Module up and running.
# cacaoadm status com.sun.cacao.rbac
Operational State:ENABLED
Administrative State:UNLOCKED
Availability Status:[]
Module is in good health.
  • Module only enabled on demand (off line for now)
#cacaoadm status com.sun.cacao.efd
Module com.sun.cacao.efd has not been loaded.
Cause of the problem:[OFF_LINE]
  • Module registered and enabled but which had a problem starting
#cacaoadm status com.sun.cacao.instrum
Operational State:DISABLED
Administrative State:UNLOCKED
Availability Status:[OFF_LINE]
  • Module not loaded by the container due to errors
#cacaoadm status com.sun.scn.base.SCNBase
Module com.sun.scn.base.SCNBase has not been loaded.
Cause of the problem:[FAILED]
  • Module not started by the container due to dependency problem
#cacaoadm status com.sun.scn.SolarisAssetModule
Module com.sun.scn.SolarisAssetModule has not been loaded.
Cause of the problem:[DEPENDENCY]

Another tips for a module developer is set correctly its dependencies. One of basics examples is connectors.

If a module offer a service using the RMI connector (if the client part of the applications access it

only using the RMI connector). If the developer knows that its entire logic will be down because if this,

the module descriptor file of the module should define a dependency on the RMI module.

Comments:

How can I check whether a module is registered or not in cacao, provided that cacao's status is stopped?
"cacaoadm list-modules" works as long as cacao is started. I'd like to know the modules in a moment in which cacao is and should remain stopped.
Thanks in advance

Posted by neidisch on novembre 30, 2009 at 08:55 AM CET #

Hi,

what you want is
cacaoadm list-modules --registered

without the option '-r|--registered' , cacaoadm
will contact the container to get the list of deployed modules.

Posted by Emmanuel Jannetti on d├ęcembre 01, 2009 at 05:55 AM CET #

Hæ again,
is there a subcommand to enable/disable a certain module?
Actually, I'd like to know the difference between the operational and administrative state.
What exactly happens to my module when I (programmatically) disable it? are my children threads still running? what about when I lock it?

Thanks!
neidisch

Posted by neidisch on juin 10, 2010 at 10:12 AM CEST #

Hi,

no. This is done by setting attributes in the module
deployment descriptor.
There is unfortunately no API for that.

A module has a state and a status. state is related
to administration action (do I want my module to be deployed or not) and status is about the health of a module (did my module is up and running, was it successfully unlocked ? )

about the last question , I guess you are talking about "locking your module"
The container will call the 'stop' method of your module. You are then responsible to clean everything. By the way if references (objects) remain in your module classloader , the container will complain about that in the logs.

Posted by Emmanuel Jannetti on juin 10, 2010 at 11:44 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Emmanuel Jannetti blog

Search

Archives
« juillet 2014
lun.mar.mer.jeu.ven.sam.dim.
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   
       
Today