All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fabric3.implementation.spring.model.SpringConsumer Maven / Gradle / Ivy

The newest version!
/*
 * Fabric3
 * Copyright (c) 2009-2015 Metaform Systems
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.fabric3.implementation.spring.model;

import java.util.Collections;

import org.fabric3.api.model.type.component.ConsumerDefinition;
import org.fabric3.api.model.type.contract.DataType;
import org.fabric3.spi.model.type.java.JavaType;

/**
 * An SCA consumer definition in a Spring application context.
 */
public class SpringConsumer extends ConsumerDefinition {
    private static final long serialVersionUID = 204519855340684340L;
    private String beanName;
    private JavaType type;
    private String methodName;

    /**
     * Constructor.
     *
     * @param name       the consumer name
     * @param type       the consumer type
     * @param targetBean the target bean name to dispatch events to
     * @param methodName the target method name on the bean to dispatch events to
     */
    public SpringConsumer(String name, JavaType type, String targetBean, String methodName) {
        super(name, Collections.singletonList(type));
        this.type = type;
        this.beanName = targetBean;
        this.methodName = methodName;
    }

    /**
     * Returns the bean name to dispatch events to.
     *
     * @return the bean name
     */
    public String getBeanName() {
        return beanName;
    }

    /**
     * Returns the name of the bean method to dispatch events to.
     *
     * @return the bean method name
     */
    public String getMethodName() {
        return methodName;
    }

    /**
     * Returns the event type
     *
     * @return the event type
     */
    public JavaType getType() {
        return type;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy