Class ComponentBoundary

java.lang.Object
org.oddjob.framework.util.ComponentBoundary

public class ComponentBoundary extends Object
Handles the crossover between components. This should probably be done with AOP but for now well do it long hand.

The typical usage is:

 public void someMethod() {
     ComponentBoundry.push(loggerName, this);
     try {
         ...
     }
     finally {
         ComponentBoundry.pop();
     }
 }
 
Author:
rob
  • Method Details

    • of

      public static ComponentBoundary of(String loggerName, Object component)
    • push

      public static Restore push(String loggerName, Object component)
      Called on entering a component method.
      Parameters:
      loggerName - The new diagnostic context information.
      component - The component.
    • wrap

      public Runnable wrap(Runnable runnable)
      Wrap a unit of execution in this Component Boundary.
      Parameters:
      runnable - The unit of execution.
      Returns:
      A new unit of execution that will execute within this Component Boundary.
    • execute

      public void execute(Runnable runnable)
      Execute a unit of execution within this Component Boundary.
      Parameters:
      runnable - The unit of execution.