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.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-maestroni on 3/7/15. * * @see com.gh.bmd.jrt.annotation.Alias Alias * @see com.gh.bmd.jrt.annotation.Priority Priority * @see com.gh.bmd.jrt.annotation.ShareGroup ShareGroup * @see com.gh.bmd.jrt.annotation.Timeout Timeout * @see com.gh.bmd.jrt.annotation.TimeoutAction 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.Alias Alias} annotation.
* Optional {@link com.gh.bmd.jrt.annotation.Priority Priority}, * {@link com.gh.bmd.jrt.annotation.ShareGroup ShareGroup}, * {@link com.gh.bmd.jrt.annotation.Timeout Timeout} and * {@link com.gh.bmd.jrt.annotation.TimeoutAction TimeoutAction} method annotations will be * honored.
* Note that such annotations will override any configuration set through the builder. *

* Note that it is up to the caller to ensure that the input data are passed to the routine in * the correct order. * * @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 aliasMethod(@Nonnull String name); /** * 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.Alias Alias} annotation. Though, optional * {@link com.gh.bmd.jrt.annotation.Priority Priority}, * {@link com.gh.bmd.jrt.annotation.ShareGroup ShareGroup}, * {@link com.gh.bmd.jrt.annotation.Timeout Timeout} and * {@link com.gh.bmd.jrt.annotation.TimeoutAction TimeoutAction} method annotations will be * honored.
* Note that such annotations will override any configuration set through the builder. *

* Note that it is up to the caller to ensure that the input data are passed to the routine in * the correct order. * * @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); /** * 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.Alias Alias} annotation. Though, optional * {@link com.gh.bmd.jrt.annotation.Priority Priority}, * {@link com.gh.bmd.jrt.annotation.ShareGroup ShareGroup}, * {@link com.gh.bmd.jrt.annotation.Timeout Timeout} and * {@link com.gh.bmd.jrt.annotation.TimeoutAction TimeoutAction} method annotations will be * honored.
* Note that such annotations will override any configuration set through the builder. *

* Note that it is up to the caller to ensure that the input data are passed to the routine in * the correct order. * * @param method the method instance. * @param the input data type. * @param the output data type. * @return the routine. */ @Nonnull Routine method(@Nonnull Method method); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy