/** * @return the identifier to name the {@link Connection}. */ protected String computeClientId(final Map<Object, Object> properties) { final String clientId = ObjectUtility.toString(properties.get(JMS_CLIENT_ID)); if (clientId != null) { return clientId; } final String nodeId = BEANS.get(NodeIdentifier.class).get(); return StringUtility.join(" ", m_symbolicName, StringUtility.box("(", nodeId, ")")); }
@SuppressWarnings("unchecked") protected IMarshaller createDefaultMarshaller(final Map<Object, Object> properties) { Object prop = properties.get(MARSHALLER); if (prop instanceof IMarshaller) { return (IMarshaller) prop; } else { Class<? extends IMarshaller> marshallerClass; String marshallerClassName = ObjectUtility.toString(prop); if (marshallerClassName != null) { try { marshallerClass = (Class<? extends IMarshaller>) Class.forName(marshallerClassName); } catch (final ClassNotFoundException | ClassCastException e) { throw new PlatformException("Failed to load class specified by environment property '{}' [value={}]", MARSHALLER, marshallerClassName, e); } } else { marshallerClass = CONFIG.getPropertyValue(DefaultMarshallerProperty.class); } return BEANS.get(marshallerClass); } }
protected void initRequestReply(final Map<Object, Object> properties) throws JMSException { m_requestReplyEnabled = BooleanUtility.nvl( TypeCastUtility.castValue(properties.get(REQUEST_REPLY_ENABLED), Boolean.class), CONFIG.getPropertyValue(RequestReplyEnabledProperty.class)); if (!m_requestReplyEnabled) { LOG.info("{}: 'request-reply' messaging is disabled", m_symbolicName); return; } // Register consumer to handle cancellation requests for 'request-reply' communication. Object prop = properties.get(IMomImplementor.REQUEST_REPLY_CANCELLATION_TOPIC); if (prop instanceof IDestination) { m_requestReplyCancellationTopic = (IDestination<?>) prop; } else { final String cancellationTopicName = ObjectUtility.toString(prop); if (cancellationTopicName != null) { final DestinationConfigPropertyParser p = BEANS.get(DestinationConfigPropertyParser.class).parse(cancellationTopicName); m_requestReplyCancellationTopic = MOM.newDestination(p.getDestinationName(), DestinationType.TOPIC, p.getResolveMethod(), p.getParameters()); } else { m_requestReplyCancellationTopic = CONFIG.getPropertyValue(RequestReplyCancellationTopicProperty.class); } } }