Registering JMX beans for jobs

You must register JMX beans for jobs and related objects before you can access them from an application. Related objects include processing elements (PEs), operators, and connections.

About this task

If you try to access a job-related bean that was not registered, the following exception occurs: javax.management.InstanceNotFoundException. The bean must also be registered to add a notification listener for the bean.

Procedure

To register job-related JMX beans, you must call one of the job registration methods on InstanceMXBean. For example:
  • registerAllJobs(java.lang.String listenerId)
  • registerJobById(String jobId)
  • registerJobById(String jobId, String listenerId)
  • registerJob(java.lang.String jobName)
  • registerJob(java.lang.String jobName, java.lang.String listenerId)
  • registerJobForPe(String peId)
  • registerJobForPe(String peId, String listenerId)
  • registerJobs(String jobGroup, String listenerId)

What to do next

If there is no activity on the job bean or one of its related object beans by any JMX client for a period, all beans that are related to the job are unregistered and deleted. This operation is done to free the memory that is associated with the unused beans. If the beans are needed again, you can register them again. Shortly before the beans are unregistered for inactivity, Teracloud Streams sends an inactivity warning notification for the job bean. If you call the keepRegistered() method or any other method on the job bean or one of its related object beans, the inactivity counter resets and delays the beans from being unregistered. For an example of how to register a job and handle the inactivity warning notifications, see Processing JMX API notifications.