Constructors Summary |
---|
public EjbReferenceDescriptor(EjbReferenceDescriptor other)copy constructor
super(other);
isLocal = other.isLocal; // boolean
refType = other.refType; // String
refHomeIntf = other.refHomeIntf; // String
refIntf = other.refIntf; // String
ejbLink = other.ejbLink; // String
referringBundle = other.referringBundle; // copy as-is
ejbDescriptor = other.ejbDescriptor;
if (ejbDescriptor != null) {
ejbDescriptor.addEjbReferencer(this); // ???
}
|
public EjbReferenceDescriptor(String name, String description, EjbDescriptor ejbDescriptor)Construct an remote ejb reference to the given ejb descriptor
with the given name and descriptor of the reference.
super(name, "", description);
this.setEjbDescriptor(ejbDescriptor);
|
public EjbReferenceDescriptor(String name, String description, EjbDescriptor ejbDescriptor, boolean isLocal)constructs an local or remote ejb reference to the given ejb descriptor,
the desciption and the name of the reference
super(name, "", description);
this.isLocal = isLocal;
this.setEjbDescriptor(ejbDescriptor);
|
public EjbReferenceDescriptor()Constructs a reference in the extrernal state.
|
Methods Summary |
---|
public boolean | equals(java.lang.Object object)
if (object instanceof EjbReference) {
EjbReference ejbReference = (EjbReference) object;
return ejbReference.getName().equals(this.getName());
}
return false;
|
public java.lang.String | getBeanClassName()
return refIntf;
|
public EjbDescriptor | getEjbDescriptor()return the ejb to whoch I refer.
return ejbDescriptor;
|
public java.lang.String | getEjbHomeInterface()Gets the home classname of the referee EJB.
return getHomeClassName();
|
public java.lang.String | getEjbInterface()Gets the local or remote interface classname of the referee EJB.
return getBeanClassName();
|
public java.lang.String | getHomeClassName()Gets the home classname of the referee EJB.
return refHomeIntf;
|
public java.lang.String | getInjectResourceType()
return isEJB30ClientView() ?
getEjbInterface() : getEjbHomeInterface();
|
public java.lang.String | getJndiName()return the jndi name of the bean to which I refer.
String jndiName = this.getValue();
if( isLocal() ) {
// mapped-name has no meaning for the local ejb view. ejb-link
// should be used to resolve any ambiguities about the target
// local ejb.
return jndiName;
} else {
return (jndiName != null && ! jndiName.equals("")) ?
jndiName : getMappedName();
}
|
public java.lang.String | getLinkName()
if (ejbDescriptor==null) {
return ejbLink;
} else {
if (ejbLink != null && ejbLink.length()!=0) {
return ejbLink;
}
return ejbDescriptor.getName();
}
|
public BundleDescriptor | getReferringBundleDescriptor()Get the referring bundle, i.e. the bundle within which this
EJB reference is declared.
return referringBundle;
|
public java.lang.String | getType()Retusn the type of the ejb to whioch I refer.
if (ejbDescriptor==null) {
return refType;
} else {
return ejbDescriptor.getType();
}
|
public java.lang.String | getValue()Return the jndi name of the bean to which I refer.
if (ejbDescriptor == null) {
return super.getValue();
} else {
if (isLocal()) {
return super.getValue();
} else {
return ejbDescriptor.getJndiName();
}
}
|
public boolean | isEJB30ClientView()
return (getHomeClassName() == null);
|
public boolean | isLinked()return true if I know the name of the ejb to which I refer.
return ejbLink!=null;
|
public boolean | isLocal()
return isLocal;
|
public void | print(java.lang.StringBuffer toStringBuffer)returns a formatted string representing me.
if (ejbDescriptor!=null) {
toStringBuffer.append("Resolved Ejb-Ref ").append(getName()).append("@jndi: ").append(getJndiName()).append(
" - > ").append(ejbDescriptor.getName());
} else {
toStringBuffer.append("Unresolved Ejb-Ref ").append(getName()).append("@jndi: ").append(getJndiName()).append("@").append(
getEjbHomeInterface()).append("@").append(getEjbInterface()).append("@").append(refType).append("@").append(ejbLink) ;
}
|
public void | setBeanClassName(java.lang.String remoteClassName)Sets the bean instance business interface classname of the bean to which I refer.
this interface is the local object or the remote interfaces depending if the
reference is local or not.
refIntf = remoteClassName;
|
public void | setEjbDescriptor(EjbDescriptor ejbDescriptor)Sets the ejb descriptor to which I refer.
if (this.ejbDescriptor != null) {
this.ejbDescriptor.removeEjbReferencer(this); // remove previous referencer
}
this.ejbDescriptor=ejbDescriptor;
if (ejbDescriptor!=null) {
ejbDescriptor.addEjbReferencer(this);
if (isLocal()) {
if (!ejbDescriptor.isLocalInterfacesSupported() &&
!ejbDescriptor.isLocalBusinessInterfacesSupported()) {
throw new RuntimeException(localStrings.getLocalString(
"entreprise.deployment.invalidLocalInterfaceReference",
"Trying to set an ejb-local-ref on an EJB while the EJB does not define local interfaces"));
}
} else {
if (!ejbDescriptor.isRemoteInterfacesSupported() &&
!ejbDescriptor.isRemoteBusinessInterfacesSupported()) {
throw new RuntimeException(localStrings.getLocalString(
"entreprise.deployment.invalidRemoteInterfaceReference",
"Trying to set an ejb-ref on an EJB, while the EJB does not define remote interfaces"));
}
}
}
|
public void | setEjbHomeInterface(java.lang.String homeClassName)Sets the local or remote home classname of the referee EJB.
setHomeClassName(homeClassName);
|
public void | setEjbInterface(java.lang.String remoteClassName)Sets the local or remote bean interface classname of the referee EJB.
setBeanClassName(remoteClassName);
|
public void | setHomeClassName(java.lang.String homeClassName)Sets the home classname of the bean to whcioh I refer.
refHomeIntf = homeClassName;
|
public void | setInjectResourceType(java.lang.String resourceType)
if (isEJB30ClientView()) {
setEjbInterface(resourceType);
} else {
setEjbHomeInterface(resourceType);
}
|
public void | setJndiName(java.lang.String jndiName)Sets the jndi name of the bean tyo whoch I am referring.
this.setValue(jndiName);
|
public void | setLinkName(java.lang.String linkName)Sets the name of the ejb to which I refer.
ejbLink = linkName;
|
public void | setLocal(boolean local)Set whether this EJB Reference uses local interfaces or remote
this.isLocal = local;
|
public void | setReferringBundleDescriptor(BundleDescriptor referringBundle)Set the referring bundle, i.e. the bundle within which this
EJB reference is declared.
this.referringBundle = referringBundle;
|
public void | setType(java.lang.String type)Assigns the type of the ejb to whcoih I refer.
refType=type;
|