Refine search
@MessageDriven(name = "VertxMonitor", messageListenerInterface = VertxListener.class, activationConfig = { @ActivationConfigProperty(propertyName = "address", propertyValue = "inbound-address"), }) public class VertxMonitor implements VertxListener {
@MessageDriven(mappedName = "jms/javaee7/Topic", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "orderAmount BETWEEN 3 AND 7") }) public class BillingMDB13 implements MessageListener { @Inject @JMSConnectionFactory("jms/javaee7/ConnectionFactory") @JMSSessionMode(JMSContext.AUTO_ACKNOWLEDGE)
@MessageDriven(mappedName = "jms/greeter") public class GreeterListener implements MessageListener { @Inject private MessageHandler handler; @Override public void onMessage(Message msg) { handler.handleMessage(msg); } }
@Override protected void introspect() { super.introspect(); MessageDriven messageDriven = getAnnotatedType().getAnnotation(MessageDriven.class); if (messageDriven != null) { ActivationConfigProperty []activationConfig = messageDriven.activationConfig(); if (activationConfig != null) { for (ActivationConfigProperty prop : activationConfig) { addActivationConfigProperty(prop.propertyName(), prop.propertyValue()); } } Class<?> type = messageDriven.messageListenerInterface(); if (type != null && ! Object.class.equals(type)) _messagingType = type; } validate(); JmsMessageListener listener = getAnnotatedType().getAnnotation(JmsMessageListener.class); if (listener != null) { addActivationConfigProperty("destination", listener.destination()); addActivationConfigProperty("consumer-max", String.valueOf(listener.consumerMax())); } }
if(annotation.name().length() > 0) metaData.setEjbName(annotation.name()); else metaData.setEjbName(beanClass.getSimpleName()); if(annotation.description().length() > 0) DescriptionGroupMetaData dg = ProcessorUtils.getDescriptionGroup(annotation.description()); metaData.setDescriptionGroup(dg); if(annotation.mappedName().length() > 0) metaData.setMappedName(annotation.mappedName()); if(annotation.messageListenerInterface() != Object.class) metaData.setMessagingType(annotation.messageListenerInterface().getName()); ActivationConfigProperty[] props = annotation.activationConfig(); ActivationConfigMetaData config = new ActivationConfigMetaData(); ActivationConfigPropertiesMetaData configProps = new ActivationConfigPropertiesMetaData(); acp.setActivationConfigPropertyName(prop.propertyName()); acp.setValue(prop.propertyValue()); configProps.add(acp);
/** * <p>MessageDrivenBean implementation of the {@link JobExecutionHandler} interface</p> * * @author Daniel Meyer */ @MessageDriven( name="JobExecutionHandlerMDB", messageListenerInterface=JobExecutionHandler.class ) @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class JobExecutionHandlerMDB implements JobExecutionHandler { public void executeJob(String job, CommandExecutor commandExecutor) { ExecuteJobHelper.executeJob(job, commandExecutor); } }
mdAn, ejbMsgBeanDesc, ejbClass, ainfo); doDescriptionProcessing(mdAn.description(), ejbMsgBeanDesc); doMappedNameProcessing(mdAn.mappedName(), ejbMsgBeanDesc); for (ActivationConfigProperty acProp : mdAn.activationConfig()) { EnvironmentProperty envProp = new EnvironmentProperty( acProp.propertyName(), acProp.propertyValue(), "");
String destination = null; String messageSelector = null; for (ActivationConfigProperty p : messageDriven.activationConfig()) { if ("destinationType".equals(p.propertyName())) { destinationType = p.propertyValue(); } else if ("destination".equals(p.propertyName())) { destination = calculateCommonName(p.propertyValue()); } else if ("acknowledgeMode".equals(p.propertyName())) {
public Map getActivationConfigProperties() { HashMap result = new HashMap(); MessageDriven mdAnnotation = (MessageDriven) resolveAnnotation(MessageDriven.class); for (ActivationConfigProperty property : mdAnnotation.activationConfig()) { addActivationSpecProperty(result, property); } DefaultActivationSpecs defaultSpecsAnnotation = (DefaultActivationSpecs)resolveAnnotation(DefaultActivationSpecs.class); if (defaultSpecsAnnotation != null) { for (ActivationConfigProperty property : defaultSpecsAnnotation.value()) { addActivationSpecProperty(result, property); } } return result; }
/** * Creates a new session bean configuration. */ public EjbMessageBean(EjbConfig ejbConfig, AnnotatedType<X> rawAnnType, AnnotatedType<X> annType, MessageDriven messageDriven) { super(ejbConfig, rawAnnType, annType, messageDriven.name()); }
public Class<?> getMessagingType() { if (messagingType == null) { MessageDriven annotation = (MessageDriven) resolveAnnotation(MessageDriven.class); messagingType = annotation.messageListenerInterface(); if (messagingType.getName().equals(Object.class.getName())) { Set<Class<?>> businessInterfaces = ProxyFactoryHelper.getBusinessInterfaces(getBeanClass(), false); if (businessInterfaces.size() > 1 || businessInterfaces.size() == 0) throw new RuntimeException("Unable to choose messagingType interface for MDB " + getEjbName() + " from " + businessInterfaces); messagingType = businessInterfaces.iterator().next(); } } return messagingType; }
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/EclipseLinkTopic"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "useSharedSubscriptionInClusteredContainer", propertyValue = "false") }) private final Map<String, JMSTopicRemoteConnection> serviceMap = new HashMap<>(); private @Inject JMSContext context; private static final Logger log = Logger.getLogger(CacheCoordinationMDB.class.getName());
= messageDriven.activationConfig(); addActivationConfigProperty(property.propertyName(), property.propertyValue()); = messageDriven.messageListenerInterface();
if(annotation.name().length() > 0) metaData.setEjbName(annotation.name()); else metaData.setEjbName(beanClass.getSimpleName()); if(annotation.description().length() > 0) DescriptionGroupMetaData dg = ProcessorUtils.getDescriptionGroup(annotation.description()); metaData.setDescriptionGroup(dg); if(annotation.mappedName().length() > 0) metaData.setMappedName(annotation.mappedName()); if(annotation.messageListenerInterface() != Object.class) metaData.setMessagingType(annotation.messageListenerInterface().getName()); ActivationConfigProperty[] props = annotation.activationConfig(); ActivationConfigMetaData config = new ActivationConfigMetaData(); ActivationConfigPropertiesMetaData configProps = new ActivationConfigPropertiesMetaData(); acp.setActivationConfigPropertyName(prop.propertyName()); acp.setValue(prop.propertyValue()); configProps.add(acp);
@MessageDriven(name = "SystemProperties") public class SystemPropertiesBean implements CrestListener { @Command public String home() { return System.getProperty("user.home"); } @Command public String home(@Exists @Directory File file) { return System.setProperty("user.home", file.getAbsolutePath()); } @Command public String dir() { return System.getProperty("user.dir"); } @Command public String dir(@Exists @Directory File file) { return System.setProperty("user.dir", file.getAbsolutePath()); } }
mdAn, ejbMsgBeanDesc, ejbClass, ainfo); doDescriptionProcessing(mdAn.description(), ejbMsgBeanDesc); doMappedNameProcessing(mdAn.mappedName(), ejbMsgBeanDesc); for (ActivationConfigProperty acProp : mdAn.activationConfig()) { EnvironmentProperty envProp = new EnvironmentProperty( acProp.propertyName(), acProp.propertyValue(), "");
protected void populateActivationSpec() { DefaultActivationSpecs defaultSpecs = (DefaultActivationSpecs) resolveAnnotation(DefaultActivationSpecs.class); if (defaultSpecs != null) { activationSpec.merge(defaultSpecs.value()); } MessageDriven md = (MessageDriven) resolveAnnotation(MessageDriven.class); activationSpec.merge(md.activationConfig()); } }
/** * Return the name attribute of given annotation. * @param annotation * @return name */ protected String getAnnotatedName(Annotation annotation) { MessageDriven mdAn = (MessageDriven)annotation; return mdAn.name(); }
if( mdAn.messageListenerInterface() != Object.class ) { intfName = mdAn.messageListenerInterface().getName(); } else { for(Class next : ejbClass.getInterfaces()) {
@RunAs("InternalUser") @MessageDriven(name = "ModificationCacheMessageBean", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/AccumuloTableCache"), @ActivationConfigProperty(propertyName = "useLocalTx", propertyValue = "true"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"), @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "ModificationCacheMessageBean"), private Logger log = Logger.getLogger(this.getClass()); @Inject private ModificationCacheBean modificationCacheBean; @Inject @SpringBean(refreshable = true) private ModificationConfiguration modificationConfiguration;