test_class.declarator: context
test_class.original_string: DefaultManagedContext context;
test_class.type: DefaultManagedContext
test_class.var_name: context
test_class.file: cosmic-common/src/test/java/com/cloud/common/managed/context/DefaultManagedContextTest.java
test_class.identifier: DefaultManagedContextTest
test_case.body: @Test
      public void testRunnable() throws Exception {
          final List<Object> touch = new ArrayList<>();
  
          this.context.runWithContext(new Runnable() {
              @Override
              public void run() {
                  touch.add(new Object());
              }
          });
  
          assertEquals(1, touch.size());
      }
test_case.class_method_signature: DefaultManagedContextTest.testRunnable()
test_case.full_signature: @Test public void testRunnable()
test_case.identifier: testRunnable
test_case.invocations: runWithContext add assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRunnable()
focal_class.declarator: log = LoggerFactory.getLogger(DefaultManagedContext.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(DefaultManagedContext.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: listeners = new CopyOnWriteArrayList<>()
focal_class.original_string: List<ManagedContextListener<?>> listeners = new CopyOnWriteArrayList<>();
focal_class.type: List<ManagedContextListener<?>>
focal_class.var_name: listeners
focal_class.file: cosmic-common/src/main/java/com/cloud/common/managed/context/DefaultManagedContext.java
focal_class.identifier: DefaultManagedContext
focal_class.interfaces: implements ManagedContext
focal_class.class_method_signature: DefaultManagedContext.registerListener(final ManagedContextListener<?> listener)
focal_class.full_signature: @Override public void registerListener(final ManagedContextListener<?> listener)
focal_class.identifier: registerListener
focal_class.modifiers: @Override public
focal_class.parameters: (final ManagedContextListener<?> listener)
focal_class.return: void
focal_class.signature: void registerListener(final ManagedContextListener<?> listener)
focal_class.class_method_signature: DefaultManagedContext.unregisterListener(final ManagedContextListener<?> listener)
focal_class.full_signature: @Override public void unregisterListener(final ManagedContextListener<?> listener)
focal_class.identifier: unregisterListener
focal_class.modifiers: @Override public
focal_class.parameters: (final ManagedContextListener<?> listener)
focal_class.return: void
focal_class.signature: void unregisterListener(final ManagedContextListener<?> listener)
focal_class.class_method_signature: DefaultManagedContext.runWithContext(final Runnable run)
focal_class.full_signature: @Override public void runWithContext(final Runnable run)
focal_class.identifier: runWithContext
focal_class.modifiers: @Override public
focal_class.parameters: (final Runnable run)
focal_class.return: void
focal_class.signature: void runWithContext(final Runnable run)
focal_class.class_method_signature: DefaultManagedContext.callWithContext(final Callable<T> callable)
focal_class.full_signature: @Override public T callWithContext(final Callable<T> callable)
focal_class.identifier: callWithContext
focal_class.modifiers: @Override public
focal_class.parameters: (final Callable<T> callable)
focal_class.return: T
focal_class.signature: T callWithContext(final Callable<T> callable)
focal_class.class_method_signature: DefaultManagedContext.throwException(final Throwable t)
focal_class.full_signature: protected void throwException(final Throwable t)
focal_class.identifier: throwException
focal_class.modifiers: protected
focal_class.parameters: (final Throwable t)
focal_class.return: void
focal_class.signature: void throwException(final Throwable t)
focal_class.class_method_signature: DefaultManagedContext.getListeners()
focal_class.full_signature: public List<ManagedContextListener<?>> getListeners()
focal_class.identifier: getListeners
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<ManagedContextListener<?>>
focal_class.signature: List<ManagedContextListener<?>> getListeners()
focal_class.class_method_signature: DefaultManagedContext.setListeners(final List<ManagedContextListener<?>> listeners)
focal_class.full_signature: public void setListeners(final List<ManagedContextListener<?>> listeners)
focal_class.identifier: setListeners
focal_class.modifiers: public
focal_class.parameters: (final List<ManagedContextListener<?>> listeners)
focal_class.return: void
focal_class.signature: void setListeners(final List<ManagedContextListener<?>> listeners)
focal_method.body: @Override
      public void runWithContext(final Runnable run) {
          try {
              callWithContext(new Callable<Object>() {
                  @Override
                  public Object call() throws Exception {
                      run.run();
                      return null;
                  }
              });
          } catch (final Exception e) {
              /* Only care about non-checked exceptions
               * as the nature of runnable prevents checked
               * exceptions from happening
               */
              ManagedContextUtils.rethrowException(e);
          }
      }
focal_method.class_method_signature: DefaultManagedContext.runWithContext(final Runnable run)
focal_method.full_signature: @Override public void runWithContext(final Runnable run)
focal_method.identifier: runWithContext
focal_method.invocations: callWithContext run rethrowException
focal_method.modifiers: @Override public
focal_method.parameters: (final Runnable run)
focal_method.return: void
focal_method.signature: void runWithContext(final Runnable run)