Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * 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;
Interface defining a builder of routines wrapping an object instance.

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

Created by davide on 3/7/15.

public interface ObjectRoutineBuilder extends ClassRoutineBuilder {

    
Returns a proxy object enabling asynchronous calling of the target instance methods.

The routines used for calling the methods will honor the attributes specified in any optional com.gh.bmd.jrt.annotation.Bind and com.gh.bmd.jrt.annotation.Timeout annotations.
In case the wrapped object does not implement the specified interface, the binding annotation value will be used to bind the interface method with the instance ones. If no annotation is present, the method name will be used instead.
The interface will be interpreted as a mirror of the target object methods, and the optional com.gh.bmd.jrt.annotation.Pass annotations will be honored.
Note that such annotations will override any configuration set through the builder.

Parameters:
itf the interface implemented by the return object.
<TYPE> the interface type.
Returns:
the proxy object.
Throws:
java.lang.IllegalArgumentException if the specified class does not represent an interface.
java.lang.NullPointerException if the specified class is null.
    @Nonnull
    <TYPE> TYPE buildProxy(@Nonnull Class<TYPE> itf);

    
Returns a proxy object enabling asynchronous calling of the target instance methods.

The routines used for calling the methods will honor the attributes specified in any optional com.gh.bmd.jrt.annotation.Bind and com.gh.bmd.jrt.annotation.Timeout annotations.
In case the wrapped object does not implement the specified interface, the binding annotation value will be used to bind the interface method with the instance ones. If no annotation is present, the method name will be used instead.
The interface will be interpreted as a mirror of the target object methods, and the optional com.gh.bmd.jrt.annotation.Pass annotations will be honored.
Note that such annotations will override any configuration set through the builder.

Parameters:
itf the token of the interface implemented by the return object.
<TYPE> the interface type.
Returns:
the proxy object.
Throws:
java.lang.IllegalArgumentException if the specified class does not represent an interface.
java.lang.NullPointerException if the specified class is null.
    @Nonnull
    <TYPE> TYPE buildProxy(@Nonnull ClassToken<TYPE> itf);

    
Note that all the options related to the output and input channels will be ignored.

Parameters:
configuration the routine configuration.
Returns:
this builder.
    @Nonnull
    @Nonnull
New to GrepCode? Check out our FAQ X