com.ibm.streams.operator.management

Class OperatorLifeCycle

  • java.lang.Object
    • com.ibm.streams.operator.management.OperatorLifeCycle
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String IBM_COPYRIGHT 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static void addAllPortsReadyAction(OperatorContext context, javax.management.NotificationListener listener)
      Register an action to be executed when an operator is notified of port readiness.
      static void addShutdownAction(OperatorContext context, javax.management.NotificationListener listener)
      Register an action to be executed when an operator is shutdown.
      static void closeOnShutdown(OperatorContext context, java.io.Closeable closeable)
      Register to close a Closeable when the operator is shutdown.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OperatorLifeCycle

        public OperatorLifeCycle()
    • Method Detail

      • closeOnShutdown

        public static void closeOnShutdown(OperatorContext context,
                           java.io.Closeable closeable)
        Register to close a Closeable when the operator is shutdown. A weak reference is maintained to closeable to avoid unbounded memory growth when an operator has some form of reconnect after failure policy that results in new Closeable instances. Therefore, an operator cannot rely on shutdown closing the instance if it discards its reference to a Closeable. In such situations the operator should close the original Closeable and invoke this method on the new Closeable.
        Any exception closing closeable is ignored.
        Parameters:
        context - Operator to be monitored for shutdown
        closeable - Object to be closed on shutdown
      • addShutdownAction

        public static void addShutdownAction(OperatorContext context,
                             javax.management.NotificationListener listener)
        Register an action to be executed when an operator is shutdown.
        Parameters:
        context - Operator to be monitored for shutdown
        listener - Listener to be executed at shutdown
        See Also:
        Operator.shutdown(), OperatorContextMXBean.SHUTDOWN
      • addAllPortsReadyAction

        public static void addAllPortsReadyAction(OperatorContext context,
                                  javax.management.NotificationListener listener)
        Register an action to be executed when an operator is notified of port readiness.
        Parameters:
        context - Operator to be monitored for port readiness
        listener - Listener to be executed at port readiness
        See Also:
        Operator.allPortsReady(), OperatorContextMXBean.ALL_PORTS_READY