jadex.bridge.service.RequiredServiceBinding Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-platform-bridge Show documentation
Show all versions of jadex-platform-bridge Show documentation
Jadex bridge is a base package for kernels and platforms, i.e., it is used by both and provides commonly used interfaces and classes for active components and their management.
package jadex.bridge.service;
import java.util.ArrayList;
import java.util.List;
import jadex.bridge.modelinfo.UnparsedExpression;
import jadex.bridge.service.component.BasicServiceInvocationHandler;
/**
* Required service binding information.
*/
public class RequiredServiceBinding
{
//-------- attributes --------
/** The service name. */
protected String name;
/** The component name used for searching. */
protected String componentname;
/** The component type, i.e. the model name used for searching. */
protected String componenttype;
///** Information about the component to create. */
//protected ComponentInstanceInfo creationinfo;
// Decided to drop caching support for v4
// /** Flag if binding is dynamic. */
// protected boolean dynamic;
/** The search scope. */
protected ServiceScope scope;
/** The scope expression (if any). */
protected UnparsedExpression scopeexpression;
// /** The create flag. */
// protected boolean create;
// Dropped support for v4
// /** The recover flag. */
// protected boolean recover;
// Dropped support for v4
/** The interceptors. */
protected List interceptors;
/** The proxytype. */
protected String proxytype;
//-------- constructors --------
/**
* Create a new binding.
*/
public RequiredServiceBinding()
{
}
/**
* Create a new binding.
*/
public RequiredServiceBinding(String name, ServiceScope scope)
{
this(name, null, null,
scope, null, BasicServiceInvocationHandler.PROXYTYPE_DECOUPLED);
}
/**
* Create a new binding.
*/
public RequiredServiceBinding(String name, String componentname, String componenttype,
ServiceScope scope, UnparsedExpression[] interceptors, String proxytype)
{
this.name = name;
this.componentname = componentname;
this.componenttype = componenttype;
this.scope = scope;
this.proxytype = proxytype;
if(interceptors!=null)
{
for(int i=0; i();
interceptors.add(interceptor);
return this;
}
/**
* Remove an interceptor.
* @param interceptor The interceptor.
*/
public RequiredServiceBinding removeInterceptor(UnparsedExpression interceptor)
{
interceptors.remove(interceptor);
return this;
}
/**
* Get the interceptors.
* @return All interceptors.
*/
public UnparsedExpression[] getInterceptors()
{
return interceptors==null? new UnparsedExpression[0]:
interceptors.toArray(new UnparsedExpression[interceptors.size()]);
}
/**
* Get the proxytype.
* @return the proxytype.
*/
public String getProxytype()
{
return proxytype;
}
/**
* Set the proxytype.
* @param proxytype The proxytype to set.
*/
public RequiredServiceBinding setProxytype(String proxytype)
{
this.proxytype = proxytype;
return this;
}
// /**
// * Get the creationname.
// * @return The creationname.
// */
// public String getCreationName()
// {
// return creationname;
// }
//
// /**
// * Set the creationname.
// * @param creationname The creationname to set.
// */
// public void setCreationName(String creationname)
// {
// this.creationname = creationname;
// }
//
// /**
// * Get the creationtype.
// * @return The creationtype.
// */
// public String getCreationType()
// {
// return creationtype;
// }
//
// /**
// * Set the creationtype.
// * @param creationtype The creationtype to set.
// */
// public void setCreationType(String creationtype)
// {
// this.creationtype = creationtype;
// }
/**
* Get the string representation.
*/
public String toString()
{
return " scope=" + scope + ", componentname=" + componentname
+ ", componenttype="+ componenttype ;//+" , creationcomp="+creationinfo;
}
}