Package org.apache.camel.spi

Examples of org.apache.camel.spi.Registry


        }
        return registry;
    }

    public <T> T getRegistry(Class<T> type) {
        Registry reg = getRegistry();

        // unwrap the property placeholder delegate
        if (reg instanceof PropertyPlaceholderDelegateRegistry) {
            reg = ((PropertyPlaceholderDelegateRegistry) reg).getRegistry();
        }

        if (type.isAssignableFrom(reg.getClass())) {
            return type.cast(reg);
        } else if (reg instanceof CompositeRegistry) {
            List<Registry> list = ((CompositeRegistry) reg).getRegistryList();
            for (Registry r : list) {
                if (type.isAssignableFrom(r.getClass())) {
View Full Code Here


    public AbstractGitHubConsumer(GitHubEndpoint endpoint, Processor processor) throws Exception {
        super(endpoint, processor);
        this.endpoint = endpoint;

        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubRepositoryService");
        if (service != null) {
            LOG.debug("Using RepositoryService found in registry " + service.getClass().getCanonicalName());
            repositoryService = (RepositoryService) service;
        } else {
            repositoryService = new RepositoryService();
View Full Code Here

    private List<Long> commentIds = new ArrayList<Long>();
   
    public PullRequestCommentConsumer(GitHubEndpoint endpoint, Processor processor) throws Exception {
        super(endpoint, processor);

        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubPullRequestService");
        if (service != null) {
            LOG.debug("Using PullRequestService found in registry " + service.getClass().getCanonicalName());
            pullRequestService = (PullRequestService) service;
        } else {
            pullRequestService = new PullRequestService();
        }
        initService(pullRequestService);

        service = registry.lookupByName("githbIssueService");
        if (service != null) {
            issueService = (IssueService) service;
        } else {
            issueService = new IssueService();
        }
View Full Code Here

    private PullRequestService pullRequestService;

    public ClosePullRequestProducer(GitHubEndpoint endpoint) throws Exception {
        super(endpoint);
       
        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubPullRequestService");
        if (service != null) {
            pullRequestService = (PullRequestService) service;
        } else {
            pullRequestService = new PullRequestService();
        }
View Full Code Here

    private int lastOpenPullRequest;

    public PullRequestConsumer(GitHubEndpoint endpoint, Processor processor) throws Exception {
        super(endpoint, processor);

        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubPullRequestService");
        if (service != null) {
            LOG.debug("Using PullRequestService found in registry " + service.getClass().getCanonicalName());
            pullRequestService = (PullRequestService) service;
        } else {
            pullRequestService = new PullRequestService();
View Full Code Here

    private List<String> commitHashes = new ArrayList<String>();
   
    public CommitConsumer(String branchName, GitHubEndpoint endpoint, Processor processor) throws Exception {
        super(endpoint, processor);

        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubCommitService");
        if (service != null) {
            LOG.debug("Using CommitService found in registry " + service.getClass().getCanonicalName());
            commitService = (CommitService) service;
        } else {
            commitService = new CommitService();
View Full Code Here

   
    public AbstractGitHubProducer(GitHubEndpoint endpoint) throws Exception {
        super(endpoint);
        this.endpoint = endpoint;

        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubRepositoryService");
        if (service != null) {
            repositoryService = (RepositoryService) service;
        } else {
            repositoryService = new RepositoryService();
        }
View Full Code Here

    private IssueService issueService;

    public PullRequestCommentProducer(GitHubEndpoint endpoint) throws Exception {
        super(endpoint);
       
        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName("githubPullRequestService");
        if (service != null) {
            LOG.debug("Using PullRequestService found in registry " + service.getClass().getCanonicalName());
            pullRequestService = (PullRequestService) service;
        } else {
            pullRequestService = new PullRequestService();
        }
        initService(pullRequestService);

        service = registry.lookupByName("githbIssueService");
        if (service != null) {
            issueService = (IssueService) service;
        } else {
            issueService = new IssueService();
        }
View Full Code Here

       
        // support to set the delay from JIRA Endpoint
        setDelay(endpoint.getDelay());

        JerseyJiraRestClientFactory factory;
        Registry registry = endpoint.getCamelContext().getRegistry();
        Object target = registry.lookupByName("JerseyJiraRestClientFactory");
        if (target != null) {
            LOG.debug("JerseyJiraRestClientFactory found in registry " + target.getClass().getCanonicalName());
            factory = (JerseyJiraRestClientFactory) target;
        } else {
            factory = new JerseyJiraRestClientFactory();
View Full Code Here

        return camelContext;
    }

    public static ParameterMappingStrategy createParameterMappingStrategy(CamelContext camelContext) {
        // lookup in registry first if there is a user define strategy
        Registry registry = camelContext.getRegistry();
        ParameterMappingStrategy answer = registry.lookupByNameAndType(BeanConstants.BEAN_PARAMETER_MAPPING_STRATEGY, ParameterMappingStrategy.class);
        if (answer == null) {
            // no then use the default one
            answer = new DefaultParameterMappingStrategy();
        }
View Full Code Here

TOP

Related Classes of org.apache.camel.spi.Registry

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.