com.almende.eve.protocol.jsonrpc.formats.Caller Maven / Gradle / Ivy
/*
* Copyright: Almende B.V. (2014), Rotterdam, The Netherlands
* License: The Apache Software License, Version 2.0
*/
package com.almende.eve.protocol.jsonrpc.formats;
import java.io.IOException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.net.URI;
import com.almende.util.TypeUtil;
import com.almende.util.callback.AsyncCallback;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.node.ObjectNode;
/**
* The Interface Receiver, implementations will be able to receive messages from
* Eve's transport service.
*/
public interface Caller {
/**
* Send async.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @param callback
* the callback
* @throws IOException
* Signals that an I/O exception has occurred.
*/
void call(final URI url, final String method, final ObjectNode params,
final AsyncCallback callback) throws IOException;
/**
* Send async for usage in proxies.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @param callback
* the callback
* @throws IOException
* Signals that an I/O exception has occurred.
*/
void call(final URI url, final Method method, final Object[] params,
final AsyncCallback callback) throws IOException;
/**
* Send async.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @throws IOException
* Signals that an I/O exception has occurred.
*/
void call(final URI url, final String method, final ObjectNode params)
throws IOException;
/**
* Call.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @throws IOException
* Signals that an I/O exception has occurred.
*/
void call(final URI url, final Method method, final Object[] params)
throws IOException;
/**
* Call sync.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @param clazz
* the clazz
* @return the t
* @throws IOException
* Signals that an I/O exception has occurred.
*/
T callSync(final URI url, final String method, final ObjectNode params,
final Class clazz) throws IOException;
/**
* Call sync.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @param type
* the type
* @return the t
* @throws IOException
* Signals that an I/O exception has occurred.
*/
T callSync(final URI url, final String method, final ObjectNode params,
final TypeUtil type) throws IOException;
/**
* Call sync.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @param type
* the type
* @return the t
* @throws IOException
* Signals that an I/O exception has occurred.
*/
T callSync(URI url, String method, ObjectNode params, JavaType type)
throws IOException;
/**
* Call sync.
*
* @param
* the generic type
* @param url
* the url
* @param method
* the method
* @param params
* the params
* @param type
* the type
* @return the t
* @throws IOException
* Signals that an I/O exception has occurred.
*/
T callSync(URI url, String method, ObjectNode params, Type type)
throws IOException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy