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

com.gh.bmd.jrt.builder.ClassRoutineBuilder Maven / Gradle / Ivy

There is a newer version: 5.9.0
Show newest version
/*
 * 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 com.gh.bmd.jrt.builder;

import com.gh.bmd.jrt.builder.RoutineConfiguration.Builder;
import com.gh.bmd.jrt.routine.Routine;

import java.lang.reflect.Method;

import javax.annotation.Nonnull;

/**
 * Interface defining a builder of routines wrapping a class method.
 * 

* Note that only static methods can be asynchronously invoked through the routines created by this * builder. *

* Created by davide on 3/7/15. * * @see com.gh.bmd.jrt.annotation.Bind * @see com.gh.bmd.jrt.annotation.ShareGroup * @see com.gh.bmd.jrt.annotation.Timeout * @see com.gh.bmd.jrt.annotation.TimeoutAction */ public interface ClassRoutineBuilder extends ConfigurableBuilder, ProxyConfigurableBuilder { /** * Returns a routine used to call the method whose identifying name is specified in a * {@link com.gh.bmd.jrt.annotation.Bind} annotation.
* Optional {@link com.gh.bmd.jrt.annotation.ShareGroup}, * {@link com.gh.bmd.jrt.annotation.Timeout} and {@link com.gh.bmd.jrt.annotation.TimeoutAction} * method annotations will be honored.
* Note that such annotations will override any configuration set through the builder. * * @param name the name specified in the annotation. * @param the input data type. * @param the output data type. * @return the routine. * @throws java.lang.IllegalArgumentException if the specified method is not found. */ @Nonnull Routine boundMethod(@Nonnull String name); /** * Returns a routine used to call the specified method. *

* The method is invoked ignoring a name specified in a * {@link com.gh.bmd.jrt.annotation.Bind} annotation. Though, optional * {@link com.gh.bmd.jrt.annotation.ShareGroup}, {@link com.gh.bmd.jrt.annotation.Timeout} and * {@link com.gh.bmd.jrt.annotation.TimeoutAction} method annotations will be honored.
* Note that such annotations will override any configuration set through the builder. * * @param method the method instance. * @param the input data type. * @param the output data type. * @return the routine. */ @Nonnull Routine method(@Nonnull Method method); /** * Returns a routine used to call the specified method. *

* The method is searched via reflection ignoring a name specified in a * {@link com.gh.bmd.jrt.annotation.Bind} annotation. Though, optional * {@link com.gh.bmd.jrt.annotation.ShareGroup}, {@link com.gh.bmd.jrt.annotation.Timeout} and * {@link com.gh.bmd.jrt.annotation.TimeoutAction} method annotations will be honored.
* Note that such annotations will override any configuration set through the builder. * * @param name the method name. * @param parameterTypes the method parameter types. * @return the routine. * @throws java.lang.IllegalArgumentException if no matching method is found. */ @Nonnull Routine method(@Nonnull String name, @Nonnull Class... parameterTypes); /** * Note that all the options related to the output and input channels will be ignored. * * @return the routine configuration builder. */ @Nonnull Builder withRoutine(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy