Package org.mule.api.registry

Examples of org.mule.api.registry.RegistrationException


    @Test(expected = RuntimeException.class)
    public void failOnRegister() throws RegistrationException
    {
        MunitPollManager manager = new MunitPollManager(muleContext);

        doThrow(new RegistrationException(CoreMessages.noMuleTransactionAvailable())).when(muleRegistry)
                .registerObject(eq("__Munit_Poll_Stopper"), any(SchedulerFactoryPostProcessor.class));

        manager.avoidPollLaunch();
    }
View Full Code Here


    @Test(expected = InitialisationException.class)
    public void testInitializeWithNoModuleObjectWhenObjectFails() throws InitialisationException, RegistrationException
    {
        MockMunitMessageProcessor mp = processorForInitialize(null);
        when(muleRegistry.lookupObject(AssertModule.class)).thenThrow(new RegistrationException(new Exception()));

        mp.initialise();
    }
View Full Code Here

                    }
                }
                Transformer trans = (Transformer) ClassUtils.instanciateClass(transClass);
                if (!(trans instanceof DiscoverableTransformer))
                {
                    throw new RegistrationException(CoreMessages.transformerNotImplementDiscoverable(trans));
                }
                if (returnClass != null)
                {
                    trans.setReturnDataType(DataTypeFactory.create(returnClass, mime));
                }
View Full Code Here

        {
            return objects.iterator().next();
        }
        else if (objects.size() > 1)
        {
            throw new RegistrationException(MessageFactory.createStaticMessage("More than one object of type " + type + " registered but only one expected."));
        }
        else
        {
            return null;
        }
View Full Code Here

    public void registerObject(String key, Object object, Object metadata) throws RegistrationException
    {
        checkDisposed();
        if (StringUtils.isBlank(key))
        {
            throw new RegistrationException(MessageFactory.createStaticMessage("Attempt to register object with no key"));
        }

        if (logger.isDebugEnabled())
        {
            logger.debug(String.format("registering key/object %s/%s", key, object));
        }

        logger.debug("applying processors");
        object = applyProcessors(object, metadata);
        if (object == null)
        {
            return;
        }

        registryMap.putAndLogWarningIfDuplicate(key, object);

        try
        {
            if (!hasFlag(metadata, MuleRegistry.LIFECYCLE_BYPASS_FLAG))
            {
                if(logger.isDebugEnabled())
                {
                    logger.debug("applying lifecycle to object: " + object);
                }
                getLifecycleManager().applyCompletedPhases(object);
            }
        }
        catch (MuleException e)
        {
            throw new RegistrationException(e);
        }
    }
View Full Code Here

    protected void checkDisposed() throws RegistrationException
    {
        if(getLifecycleManager().isPhaseComplete(Disposable.PHASE_NAME))
        {
            throw new RegistrationException(MessageFactory.createStaticMessage("Cannot register objects on the registry as the context is disposed"));
        }
    }
View Full Code Here

                getLifecycleManager().applyPhase(obj, lifecycleManager.getCurrentPhase(), Disposable.PHASE_NAME);
            }
        }
        catch (MuleException e)
        {
            throw new RegistrationException(e);
        }

    }
View Full Code Here

        {
            return bindings.get(0).getProvider().get();
        }
        else
        {
            throw new RegistrationException(MessageFactory.createStaticMessage("More than one object of type: " + type + ", was found"));
        }
    }
View Full Code Here

        {
            endpoint = getRecipientEndpointFromString(message, (String) recipient);
        }
        if (null == endpoint)
        {
            throw new RegistrationException(MessageFactory.createStaticMessage("Failed to create endpoint for: " + recipient));
        }

        OutboundEndpoint existingEndpoint = recipientCache.putIfAbsent(recipient, endpoint);
        if (existingEndpoint != null)
        {
View Full Code Here

        {
            return getComponent(flowConstruct);
        }
        else
        {
            throw new RegistrationException(MessageFactory.createStaticMessage("Service " + serviceName
                                                                               + " not found in Registry"));
        }
    }
View Full Code Here

TOP

Related Classes of org.mule.api.registry.RegistrationException

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.