Methods Summary |
---|
public ActivationConfigDescriptor | getActivationConfigDescriptor()
return activationConfig;
|
public java.util.Set | getActivationConfigProperties()
return activationConfig.getActivationConfig();
|
public java.lang.String | getActivationConfigValue(java.lang.String name)
for(Iterator iter = activationConfig.getActivationConfig().iterator();
iter.hasNext();) {
EnvironmentProperty next = (EnvironmentProperty) iter.next();
if( next.getName().equals(name) ) {
return (String) next.getValue();
}
}
return null;
|
public java.lang.String | getConnectionFactoryName()
return connectionFactoryName;
|
public java.lang.String | getDestinationType()
return destinationType;
|
public java.lang.String | getDurableSubscriptionName()
return durableSubscriptionName;
|
public int | getJmsAcknowledgeMode()
String ackModeStr = getActivationConfigValue(ACK_MODE_PROPERTY);
return ( (ackModeStr != null) && ackModeStr.equals(DUPS_OK_ACK) ) ?
Session.DUPS_OK_ACKNOWLEDGE : Session.AUTO_ACKNOWLEDGE;
|
public java.lang.String | getJmsAcknowledgeModeAsString()
return getActivationConfigValue(ACK_MODE_PROPERTY);
|
public java.lang.String | getJmsMessageSelector()
return getActivationConfigValue(MESSAGE_SELECTOR_PROPERTY);
|
public com.sun.enterprise.deployment.EjbMessageBeanDescriptor | getMessageBeanOwner()Get the descriptor for the message-driven bean owner.
return this;
|
public MessageDestinationDescriptor | getMessageDestination()
return msgDestReferencer.getMessageDestination();
|
public java.lang.String | getMessageDestinationLinkName()
return msgDestReferencer.getMessageDestinationLinkName();
|
public MessageDestinationReferenceDescriptor | getMessageDestinationRefOwner()
return null;
|
public java.lang.reflect.Method[] | getMessageListenerInterfaceMethods(java.lang.ClassLoader classLoader)This returns the message listener onMessage method from the
*message listener interface* itself, as opposed to the method
from the ejb class that implements it.
Method[] methods;
try {
Class messageListenerClass =
classLoader.loadClass(messageListenerType);
methods = messageListenerClass.getDeclaredMethods();
if( methods.length == 0 ) {
throw new NoSuchMethodException
("MessageListener interface " + messageListenerType +
" must declare at least one method");
}
} catch(Exception e) {
NoSuchMethodException nsme = new NoSuchMethodException();
nsme.initCause(e);
throw nsme;
}
return methods;
|
public java.lang.String | getMessageListenerType()
return messageListenerType;
|
public java.util.Vector | getMethods(java.lang.ClassLoader classLoader)
// @@@
return new Vector();
|
public java.util.Vector | getPossibleTransactionAttributes()
Vector txAttributes = new Vector();
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRED, ""));
txAttributes.add(new ContainerTransaction
(ContainerTransaction.NOT_SUPPORTED, ""));
if( isTimedObject() ) {
txAttributes.add(new ContainerTransaction
(ContainerTransaction.REQUIRES_NEW, ""));
}
return txAttributes;
|
public java.lang.String | getResourceAdapterMid()
return resourceAdapterMid;
|
public ActivationConfigDescriptor | getRuntimeActivationConfigDescriptor()
return runtimeActivationConfig;
|
public java.util.Set | getRuntimeActivationConfigProperties()
return runtimeActivationConfig.getActivationConfig();
|
public java.lang.String | getRuntimeActivationConfigValue(java.lang.String name)
for(Iterator iter =
runtimeActivationConfig.getActivationConfig().iterator();
iter.hasNext();) {
EnvironmentProperty next = (EnvironmentProperty) iter.next();
if( next.getName().equals(name) ) {
return (String) next.getValue();
}
}
return null;
|
public java.util.Set | getSecurityBusinessMethodDescriptors()
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptioncannotgetsecbusmethodsinmsgbean",
"Cannot get business method for security for message-driven bean."));
|
protected java.util.Collection | getTransactionMethods(java.lang.ClassLoader classLoader)
Vector txMethods = new Vector();
if( beanClassTxMethods == null ) {
try {
beanClassTxMethods = new HashSet();
Class ejbClass = classLoader.loadClass(this.getEjbClassName());
Method interfaceMessageListenerMethods[] =
getMessageListenerInterfaceMethods(classLoader);
for(int i = 0; i < interfaceMessageListenerMethods.length;
i++) {
Method next = interfaceMessageListenerMethods[i];
// Convert method objects from MessageListener interface
// to method objects from ejb class
Method nextBeanMethod = ejbClass.getMethod
(next.getName(), next.getParameterTypes());
beanClassTxMethods.add(new MethodDescriptor(nextBeanMethod, MethodDescriptor.EJB_BEAN));
}
if( isTimedObject() ) {
beanClassTxMethods.add(getEjbTimeoutMethod());
}
}
catch(Exception e) {
NoSuchMethodError nsme = new NoSuchMethodError(localStrings.getLocalString("enterprise.deployment.noonmessagemethod", "", new Object[] {
getEjbClassName(), getMessageListenerType() }));
nsme.initCause(e);
throw nsme;
}
}
txMethods.addAll(beanClassTxMethods);
return txMethods;
|
public java.util.Set | getTxBusinessMethodDescriptors()
ClassLoader classLoader = getEjbBundleDescriptor().getClassLoader();
Set methods = new HashSet();
try {
addAllInterfaceMethodsIn
(methods, classLoader.loadClass(messageListenerType),
MethodDescriptor.EJB_BEAN);
if (isTimedObject()) {
methods.add(getEjbTimeoutMethod());
}
} catch (Throwable t) {
_logger.log(Level.SEVERE,"enterprise.deployment.backend.methodClassLoadFailure",new Object [] {"(EjbDescriptor.getBusinessMethodDescriptors())"});
throw new RuntimeException(t);
}
return methods;
|
public java.lang.String | getType()Returns the type of this bean - always "Message-driven".
return TYPE;
|
public boolean | hasConnectionFactory()
return (connectionFactoryName != null);
|
public boolean | hasDestinationType()
return (destinationType != null);
|
public boolean | hasDurableSubscription()
String value = getActivationConfigValue(DURABLE_SUBSCRIPTION_PROPERTY);
return ( (value != null) && value.equals(DURABLE) );
|
public boolean | hasJmsMessageSelector()
return ( getActivationConfigValue(MESSAGE_SELECTOR_PROPERTY) != null );
|
public boolean | hasMessageDestinationLinkName()
return (msgDestReferencer.getMessageDestinationLinkName() != null);
|
public boolean | hasQueueDest()
return ( (destinationType != null) &&
(destinationType.equals("javax.jms.Queue")) );
|
public boolean | hasResourceAdapterMid()
return (resourceAdapterMid != null);
|
public boolean | hasTopicDest()
return ( (destinationType != null) &&
(destinationType.equals("javax.jms.Topic")) );
|
public boolean | isLinkedToMessageDestination()
return msgDestReferencer.isLinkedToMessageDestination();
|
public boolean | ownedByMessageBean()True if the owner is a message-driven bean.
return true;
|
public boolean | ownedByMessageDestinationRef()
return false;
|
public void | print(java.lang.StringBuffer toStringBuffer)Returns a formatted String of the attributes of this object.
super.print(toStringBuffer);
toStringBuffer.append("Message-driven descriptor : ").append(
activationConfig.getActivationConfig()).append(
runtimeActivationConfig.getActivationConfig());
|
public void | putActivationConfigProperty(EnvironmentProperty prop)
// remove first an existing property with the same name
removeActivationConfigPropertyByName(prop.getName());
activationConfig.getActivationConfig().add(prop);
|
public void | putRuntimeActivationConfigProperty(EnvironmentProperty prop)
runtimeActivationConfig.getActivationConfig().add(prop);
|
public void | removeActivationConfigProperty(EnvironmentProperty prop)
for(Iterator iter = activationConfig.getActivationConfig().iterator();
iter.hasNext();) {
EnvironmentProperty next = (EnvironmentProperty) iter.next();
if( next.getName().equals(prop.getName()) &&
next.getValue().equals(prop.getValue()) ) {
iter.remove();
break;
}
}
|
public void | removeActivationConfigPropertyByName(java.lang.String name)
for(Iterator iter = activationConfig.getActivationConfig().iterator();
iter.hasNext();) {
EnvironmentProperty next = (EnvironmentProperty) iter.next();
if( next.getName().equals(name) ) {
iter.remove();
break;
}
}
|
public void | removeRuntimeActivationConfigProperty(EnvironmentProperty prop)
for(Iterator iter =
runtimeActivationConfig.getActivationConfig().iterator();
iter.hasNext();) {
EnvironmentProperty next = (EnvironmentProperty) iter.next();
if( next.getName().equals(prop.getName()) &&
next.getValue().equals(prop.getValue()) ) {
iter.remove();
break;
}
}
|
public void | removeRuntimeActivationConfigPropertyByName(java.lang.String name)
for(Iterator iter =
runtimeActivationConfig.getActivationConfig().iterator();
iter.hasNext();) {
EnvironmentProperty next = (EnvironmentProperty) iter.next();
if( next.getName().equals(name) ) {
iter.remove();
break;
}
}
|
public MessageDestinationDescriptor | resolveLinkName()
return msgDestReferencer.resolveLinkName();
|
public void | setActivationConfigDescriptor(ActivationConfigDescriptor desc)
activationConfig = desc;
|
public void | setConnectionFactoryName(java.lang.String connectionFactory)Connection factory is optional. If set to null,
hasConnectionFactory will return false.
connectionFactoryName = connectionFactory;
|
public void | setContainerTransactionFor(MethodDescriptor methodDescriptor, ContainerTransaction containerTransaction)
Vector allowedTxAttributes = getPossibleTransactionAttributes();
if( allowedTxAttributes.contains(containerTransaction) ) {
super.setContainerTransactionFor
(methodDescriptor, containerTransaction);
}
else {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.msgbeantxattrnotvalid",
"Invalid transaction attribute for message-driven bean"));
}
|
public void | setDestinationType(java.lang.String destType)
destinationType = destType;
|
public void | setDurableSubscriptionName(java.lang.String durableSubscriptionName)
this.durableSubscriptionName = durableSubscriptionName;
super.changed();
|
public void | setHasDurableSubscription(boolean durable)
if( durable ) {
EnvironmentProperty durableProp =
new EnvironmentProperty(DURABLE_SUBSCRIPTION_PROPERTY,
DURABLE, "");
putActivationConfigProperty(durableProp);
} else {
removeActivationConfigPropertyByName(DURABLE_SUBSCRIPTION_PROPERTY);
}
super.changed();
|
public void | setHasQueueDest()
destinationType = "javax.jms.Queue";
setHasDurableSubscription(false);
super.changed();
|
public void | setHasTopicDest()
destinationType = "javax.jms.Topic";
super.changed();
|
public void | setJmsAcknowledgeMode(int acknowledgeMode)
String ackModeValue = (acknowledgeMode == Session.AUTO_ACKNOWLEDGE) ?
AUTO_ACK : DUPS_OK_ACK;
EnvironmentProperty ackModeProp =
new EnvironmentProperty(ACK_MODE_PROPERTY, ackModeValue, "");
putActivationConfigProperty(ackModeProp);
super.changed();
|
public void | setJmsAcknowledgeMode(java.lang.String acknowledgeMode)
if (AUTO_ACK.equals(acknowledgeMode)) {
setJmsAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
} else {
if (DUPS_OK_ACK.equals(acknowledgeMode)) {
setJmsAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE);
} else {
throw new IllegalArgumentException
("Invalid jms acknowledge mode : " + acknowledgeMode);
}
}
|
public void | setJmsMessageSelector(java.lang.String selector)
if( (selector == null) || (selector.trim().equals("")) ) {
removeActivationConfigPropertyByName(MESSAGE_SELECTOR_PROPERTY);
} else {
EnvironmentProperty msgSelectorProp =
new EnvironmentProperty(MESSAGE_SELECTOR_PROPERTY,selector,"");
putActivationConfigProperty(msgSelectorProp);
}
super.changed();
|
public void | setMessageDestination(MessageDestinationDescriptor newMsgDest)
msgDestReferencer.setMessageDestination(newMsgDest);
|
public void | setMessageDestinationLinkName(java.lang.String linkName)Sets the name of the message destination to which I refer.
msgDestReferencer.setMessageDestinationLinkName(linkName);
|
public MessageDestinationDescriptor | setMessageDestinationLinkName(java.lang.String linkName, boolean resolveLink)
return msgDestReferencer.setMessageDestinationLinkName
(linkName, resolveLink);
|
public void | setMessageListenerType(java.lang.String messagingType)
messageListenerType = messagingType;
// Clear message listener methods so transaction methods will be
// recomputed using new message listener type;
beanClassTxMethods = null;
|
public void | setResourceAdapterMid(java.lang.String resourceAdapterMid)resource-adapter-mid is optional. It is set when
a resource adapter is responsible for delivering
messages to the message-driven bean. If not set,
hasResourceAdapterMid will return false.
this.resourceAdapterMid = resourceAdapterMid;
|
public void | setRuntimeActivationConfigDescriptor(ActivationConfigDescriptor desc)
runtimeActivationConfig = desc;
|
public void | setSubscriptionDurability(java.lang.String subscription)
if (subscription.equals(DURABLE)) {
setHasDurableSubscription(true);
}
else if (subscription.equals(NON_DURABLE)) {
setHasDurableSubscription(false);
} else {
throw new IllegalArgumentException
("Invalid subscription durability string : " + subscription);
}
|
public void | setTransactionType(java.lang.String transactionType)Sets the transaction type for this bean.
Must be either BEAN_TRANSACTION_TYPE or CONTAINER_TRANSACTION_TYPE.
boolean isValidType = (BEAN_TRANSACTION_TYPE.equals(transactionType) ||
CONTAINER_TRANSACTION_TYPE.equals(transactionType));
if (!isValidType && this.isBoundsChecking()) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptionmsgbeantxtypenotlegaltype",
"{0} is not a legal transaction type for a message-driven bean", new Object[] {transactionType}));
} else {
super.transactionType = transactionType;
super.setMethodContainerTransactions(new Hashtable());
super.changed();
}
|
public void | setType(java.lang.String type)Sets my type
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.exceptioncannotsettypeofmsgdrivenbean",
"Cannot set the type of a message-drive bean"));
|