public static ConnectorXmlDescriptor process(boolean resolveProperties, VirtualFile file, VirtualFile alternateDescriptor, String deploymentName) throws DeploymentUnitProcessingException { // Locate the descriptor final VirtualFile serviceXmlFile; if (alternateDescriptor != null) { serviceXmlFile = alternateDescriptor; } else { serviceXmlFile = file.getChild("/META-INF/ra.xml"); } InputStream xmlStream = null; Connector result = null; try { if (serviceXmlFile != null && serviceXmlFile.exists()) { xmlStream = serviceXmlFile.openStream(); RaParser raParser = new RaParser(); raParser.setSystemPropertiesResolved(resolveProperties); result = raParser.parse(xmlStream); if (result == null) throw ConnectorLogger.ROOT_LOGGER.failedToParseServiceXml(serviceXmlFile); } File root = file.getPhysicalFile(); URL url = root.toURI().toURL(); return new ConnectorXmlDescriptor(result, root, url, deploymentName); } catch (Exception e) { throw ConnectorLogger.ROOT_LOGGER.failedToParseServiceXml(e, serviceXmlFile); } finally { VFSUtils.safeClose(xmlStream); } }
private InboundResourceAdapter createInbound(List<ConfigProperty> inboundProps) { List<RequiredConfigProperty> destination = Collections.<RequiredConfigProperty>singletonList(new RequiredConfigPropertyImpl(EMPTY_LOCL, str("destination"), null)); Activationspec activation15 = new ActivationSpecImpl(str(ACTIVEMQ_ACTIVATION), destination, inboundProps, null); List<MessageListener> messageListeners = Collections.<MessageListener>singletonList(new MessageListenerImpl(str(JMS_MESSAGE_LISTENER), activation15, null)); Messageadapter message = new MessageAdapterImpl(messageListeners, null); return new InboundResourceAdapterImpl(message, null); }
/** * * Static method to get enum instance given localName string * * @param localName a string used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static Connector16Tag forName(String localName) { final Connector16Tag element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; }
private static OutboundResourceAdapter createOutbound(List<ConfigProperty> outboundProperties) { List<org.jboss.jca.common.api.metadata.spec.ConnectionDefinition> definitions = new ArrayList(); List<ConfigProperty> props = new ArrayList(outboundProperties); props.add(simpleProperty15(SESSION_DEFAULT_TYPE, STRING_TYPE, JMS_QUEUE)); props.add(simpleProperty15(TRY_LOCK, INTEGER_TYPE, "0")); definitions.add(new org.jboss.jca.common.metadata.spec.ConnectionDefinitionImpl(str(RAMANAGED_CONN_FACTORY), props, str(RA_CONN_FACTORY), str(RA_CONN_FACTORY_IMPL), str(JMS_SESSION), str(ACTIVEMQ_RA_SESSION), null)); AuthenticationMechanism basicPassword = new AuthenticationMechanismImpl(Collections.<LocalizedXsdString>emptyList(), str(BASIC_PASS), CredentialInterfaceEnum.PasswordCredential, null, null); return new OutboundResourceAdapterImpl(definitions, TransactionSupportEnum.XATransaction, Collections.singletonList(basicPassword), false, null, null, null); }
@Override public Connector parse(InputStream xmlInputStream) throws Exception { XMLStreamReader reader = null; XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE); reader = inputFactory.createXMLStreamReader(xmlInputStream); return parse(reader); }
/** * {@inheritDoc} */ public CopyableMetaData copy() { return new InboundResourceAdapterImpl(CopyUtil.clone(messageadapter), CopyUtil.cloneString(id)); }
/** * {@inheritDoc} */ public CopyableMetaData copy() { return new RequiredConfigPropertyImpl(CopyUtil.cloneList(description), CopyUtil.clone(configPropertyName), CopyUtil.cloneString(id)); }
/** * {@inheritDoc} */ public CopyableMetaData copy() { return new AuthenticationMechanismImpl(CopyUtil.cloneList(description), CopyUtil.clone(authenticationMechanismType), credentialInterface, CopyUtil.cloneString(id), CopyUtil.cloneString(cIId)); }
/** * {@inheritDoc} */ public CopyableMetaData copy() { return new ResourceAdapterImpl(CopyUtil.clone(resourceadapterClass), CopyUtil.cloneList(configProperties), CopyUtil.clone(outboundResourceadapter), CopyUtil.clone(inboundResourceadapter), CopyUtil.cloneList(adminobjects), CopyUtil.cloneList(securityPermissions), CopyUtil.cloneString(id)); }
/** * * Static method to get enum instance given localName string * * @param localName a string used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static ActivationSpecTag forName(String localName) { final ActivationSpecTag element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; }
/** * * Static method to get enum instance given localName string * * @param localName a string used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static ConfigPropertyTag forName(String localName) { final ConfigPropertyTag element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; }
/** * * Static method to get enum instance given localName string * * @param localName a string used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static AdminObjectTag forName(String localName) { final AdminObjectTag element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; }
/** * * Static method to get enum instance given localName string * * @param localName a string used as localname (typically tag name as defined in xsd) * @return the enum instance */ public static LicenseTag forName(String localName) { final LicenseTag element = MAP.get(localName); return element == null ? UNKNOWN.value(localName) : element; }
/** * {@inheritDoc} */ public CopyableMetaData copy() { return new LicenseTypeImpl(CopyUtil.cloneList(description), licenseRequired, CopyUtil.cloneString(id), CopyUtil.cloneString(licReqId)); }
private InboundResourceAdapter createInbound(List<ConfigProperty> inboundProps) { List<RequiredConfigProperty> destination = Collections.<RequiredConfigProperty>singletonList(new RequiredConfigPropertyImpl(EMPTY_LOCL, str("destination"), null)); Activationspec activation15 = new ActivationSpecImpl(str(ACTIVEMQ_ACTIVATION), destination, inboundProps, null); List<MessageListener> messageListeners = Collections.<MessageListener>singletonList(new MessageListenerImpl(str(JMS_MESSAGE_LISTENER), activation15, null)); Messageadapter message = new MessageAdapterImpl(messageListeners, null); return new InboundResourceAdapterImpl(message, null); }
private static OutboundResourceAdapter createOutbound(List<ConfigProperty> outboundProperties) { List<org.jboss.jca.common.api.metadata.spec.ConnectionDefinition> definitions = new ArrayList(); List<ConfigProperty> props = new ArrayList(outboundProperties); props.add(simpleProperty15(SESSION_DEFAULT_TYPE, STRING_TYPE, JMS_QUEUE)); props.add(simpleProperty15(TRY_LOCK, INTEGER_TYPE, "0")); definitions.add(new org.jboss.jca.common.metadata.spec.ConnectionDefinitionImpl(str(RAMANAGED_CONN_FACTORY), props, str(RA_CONN_FACTORY), str(RA_CONN_FACTORY_IMPL), str(JMS_SESSION), str(ACTIVEMQ_RA_SESSION), null)); AuthenticationMechanism basicPassword = new AuthenticationMechanismImpl(Collections.<LocalizedXsdString>emptyList(), str(BASIC_PASS), CredentialInterfaceEnum.PasswordCredential, null, null); return new OutboundResourceAdapterImpl(definitions, TransactionSupportEnum.XATransaction, Collections.singletonList(basicPassword), false, null, null, null); }
private InboundResourceAdapter createInbound(List<ConfigProperty> inboundProps) { List<RequiredConfigProperty> destination = Collections.<RequiredConfigProperty>singletonList(new RequiredConfigPropertyImpl(EMPTY_LOCL, str("destination"), null)); Activationspec activation15 = new ActivationSpecImpl(str(ACTIVEMQ_ACTIVATION), destination, inboundProps, null); List<MessageListener> messageListeners = Collections.<MessageListener>singletonList(new MessageListenerImpl(str(JMS_MESSAGE_LISTENER), activation15, null)); Messageadapter message = new MessageAdapterImpl(messageListeners, null); return new InboundResourceAdapterImpl(message, null); }
private static OutboundResourceAdapter createOutbound(List<ConfigProperty> outboundProperties) { List<org.jboss.jca.common.api.metadata.spec.ConnectionDefinition> definitions = new ArrayList<>(); List<ConfigProperty> props = new ArrayList<>(outboundProperties); props.add(simpleProperty15(SESSION_DEFAULT_TYPE, STRING_TYPE, JMS_QUEUE)); props.add(simpleProperty15(TRY_LOCK, INTEGER_TYPE, "0")); definitions.add(new org.jboss.jca.common.metadata.spec.ConnectionDefinitionImpl(str(RAMANAGED_CONN_FACTORY), props, str(RA_CONN_FACTORY), str(RA_CONN_FACTORY_IMPL), str(JMS_SESSION), str(ACTIVEMQ_RA_SESSION), null)); AuthenticationMechanism basicPassword = new AuthenticationMechanismImpl(Collections.<LocalizedXsdString>emptyList(), str(BASIC_PASS), CredentialInterfaceEnum.PasswordCredential, null, null); return new OutboundResourceAdapterImpl(definitions, TransactionSupportEnum.XATransaction, Collections.singletonList(basicPassword), false, null, null, null); }
private InboundResourceAdapter createInbound(List<ConfigProperty> inboundProps) { List<RequiredConfigProperty> destination = Collections.<RequiredConfigProperty>singletonList(new RequiredConfigPropertyImpl(EMPTY_LOCL, str("destination"), null)); Activationspec activation15 = new ActivationSpecImpl(str(ACTIVEMQ_ACTIVATION), destination, inboundProps, null); List<MessageListener> messageListeners = Collections.<MessageListener>singletonList(new MessageListenerImpl(str(JMS_MESSAGE_LISTENER), activation15, null)); Messageadapter message = new MessageAdapterImpl(messageListeners, null); return new InboundResourceAdapterImpl(message, null); }
private static OutboundResourceAdapter createOutbound(List<ConfigProperty> outboundProperties) { List<org.jboss.jca.common.api.metadata.spec.ConnectionDefinition> definitions = new ArrayList<>(); List<ConfigProperty> props = new ArrayList<>(outboundProperties); props.add(simpleProperty15(SESSION_DEFAULT_TYPE, STRING_TYPE, JMS_QUEUE)); props.add(simpleProperty15(TRY_LOCK, INTEGER_TYPE, "0")); definitions.add(new org.jboss.jca.common.metadata.spec.ConnectionDefinitionImpl(str(RAMANAGED_CONN_FACTORY), props, str(RA_CONN_FACTORY), str(RA_CONN_FACTORY_IMPL), str(JMS_SESSION), str(ACTIVEMQ_RA_SESSION), null)); AuthenticationMechanism basicPassword = new AuthenticationMechanismImpl(Collections.<LocalizedXsdString>emptyList(), str(BASIC_PASS), CredentialInterfaceEnum.PasswordCredential, null, null); return new OutboundResourceAdapterImpl(definitions, TransactionSupportEnum.XATransaction, Collections.singletonList(basicPassword), false, null, null, null); }