Package org.milyn.javabean.repository

Examples of org.milyn.javabean.repository.BeanId


          for(int i = 0; i < 1000; i++) {

            Object bean = new Object();

            //log.info(threadName + " Add bean " + beanId);
            BeanId beanId = beanContext.getBeanId("beanId" + i);
            beanContext.addBean(beanId, bean, null);
            beanContext.addBean(beanId, bean, null);

            //log.info(threadName + " Get bean " + beanId);
View Full Code Here


        final BeanRouterObserver beanRouterObserver = new BeanRouterObserver(beanRouter, beanId);
        final MockExecutionContext smooksExecutionContext = new MockExecutionContext();
        final BeanContextLifecycleEvent event = mock(BeanContextLifecycleEvent.class);
       
        when(event.getBeanId()).thenReturn(new BeanId(null, 0, beanId));
        when(event.getLifecycle()).thenReturn(BeanLifecycle.END_FRAGMENT);
        when(event.getBean()).thenReturn(sampleBean);
        when(event.getExecutionContext()).thenReturn(smooksExecutionContext);
   
        endpoint.setExpectedMessageCount(1);
View Full Code Here

        try {
            ExecutionContext execContext = smooks.createExecutionContext();
            BeanContext beanContext = execContext.getBeanContext();
            BeanIdStore beanIdStore =  execContext.getContext().getBeanIdStore();

            BeanId requiredOrderNumId = beanIdStore.register("requiredOrderNum");

            beanContext.addBean(requiredOrderNumId, 9999, null);
            try {
                smooks.filterSource(execContext, new StringSource("<doc/>"), null);
                fail("Expected DataSelectionException");
View Full Code Here

                source, BeanLifecycle.START_FRAGMENT, beanContext.getBeanId(bindTo), ""));
    }

    public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) {
        BeanContext beanContext = executionContext.getBeanContext();
        BeanId beanId = beanContext.getBeanId(bindTo);
        Object bean = beanContext.getBean(beanId);

        beanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, fragment, BeanLifecycle.END_FRAGMENT, beanId, bean));
        if(!retain) {
            executionContext.getBeanContext().removeBean(beanId, null);
View Full Code Here

    AssertArgument.isNotNull(executionContext, "executionContext");
    AssertArgument.isNotNullAndNotEmpty(beanId, "beanId");
    AssertArgument.isNotNull(bean, "bean");

    BeanId beanIdObj = getBeanId(executionContext.getContext().getBeanIdStore(), beanId);

    executionContext.getBeanContext().addBean(beanIdObj, bean, null);

    }
View Full Code Here

      AssertArgument.isNotNull(executionContext, "executionContext");
    AssertArgument.isNotNullAndNotEmpty(beanId, "beanId");
    AssertArgument.isNotNull(bean, "bean");

    BeanId beanIdObj = getBeanId(executionContext.getContext().getBeanIdStore(), beanId);

    executionContext.getBeanContext().changeBean(beanIdObj, bean, null);
    }
View Full Code Here

   * @param beanId
   */
  private static BeanId getBeanId(BeanIdStore beanIdStore, String beanId) {
    warnUsingDeprecatedMethod();

    BeanId beanIdObj = beanIdStore.getBeanId(beanId);

    if (beanIdObj == null) {
      beanIdObj = beanIdStore.register(beanId);
    }

View Full Code Here

  /* (non-Javadoc)
   * @see org.milyn.javabean.lifecycle.BeanContextLifecycleObserver#onBeanLifecycleEvent(org.milyn.javabean.lifecycle.BeanContextLifecycleEvent)
   */
  public void onBeanLifecycleEvent(BeanContextLifecycleEvent event) {
    BeanId beanId = event.getBeanId();
    BeanLifecycle lifecycle = event.getLifecycle();   
   
    if(lifecycle == BeanLifecycle.ADD) {
      if(watchedBeanId != null && beanId != watchedBeanId) {
        return;
View Full Code Here

      final String beanIdName,
      final Object bean)
  {
        final MockExecutionContext executionContext = new MockExecutionContext();

        BeanId beanId = executionContext.getContext().getBeanIdStore().register(beanIdName);
        executionContext.getBeanContext().addBean(beanId, bean, null);
        return executionContext;
  }
View Full Code Here

TOP

Related Classes of org.milyn.javabean.repository.BeanId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.