under ojc-core/component-common; its source can be browsed here: OJC CVS repository
.
library to implement redelivery and throttling. The library supports parsing of design-time artifacts as well as runtime implementation of retry attempts and throttling. For more information, visit the Redelivery and Throttling wiki pages.
method, the current design for systemic configuration links service qualities (i.e. redelivery, throttling) to the consumer endpoint of a connection, because only the consumer is guaranteed to be unique within the JBI environment. In Binding Components, a protocol-specific endpoint is always a provider in a connection, meaning service qualities cannot be linked to that endpoint.
utility.
When fetching a configuration value, ComponentConfig
will always return a non-null Property, even if a Property with the specified name doesn't exist. The value returned from that Property will be null.
// copied from com.sun.jbi.common.qos.config.AbstractConfigMBean
public AbstractConfigMBean(ComponentContext ctx,
ComponentConfig config) throws DeploymentException {
mLogger = Util.getLogger(ctx, RuntimeConfigurationMBean.class.getName());
mWorkspaceRoot = ctx.getWorkspaceRoot();
if (config == null) {
mConfig = ComponentConfig.parse(ctx.getInstallRoot());
// will not fail if config.properties in workspace root doesn't exist
ConfigPersistence.loadConfig(mConfig, mWorkspaceRoot);
}
else {
mConfig = config;
}
}
// a component's implementation of its runtime configuration MBean
// would implement its getters/setters as follows (from com.sun.jbi.engine.xslt.XsltSEConfig):
public class XsltSEConfig extends AbstractConfigMBean implements XsltSEConfigMBean {
public XsltSEConfig(ComponentContext ctx, ComponentConfig config)
throws DeploymentException {
super(ctx, config);
}
/** @see com.sun.jbi.component.config.PollerConfigMBean#getPollerCount() */
public Integer getPollerCount() {
return Integer.valueOf(getConfig().getProperty(POLLER_COUNT_PROPERTY).getValue());
}
/** @see com.sun.jbi.component.config.PollerConfigMBean#setPollerCount(java.lang.Integer) */
public void setPollerCount(Integer count) {
int val = (count == null) ? DEFAULT_POLLER_COUNT : count.intValue();
getConfig().getProperty(POLLER_COUNT_PROPERTY).setValue(String.valueOf(val));
}
}
implementation to install endpoints' configured service qualities.
MessagingChannel, some may require information about a deployed service unit's service assembly, for example:
public String lookupServiceAssemblyName(ComponentContext ctx, String serviceUnitName) {
DeploymentLookup lookup = new DeploymentLookup(ctx);
ServiceAssembly sa = lookup.getServiceAssembly(serviceUnitName);
return sa.getIdentification().getName();
}
only works in a JBI environment running in GlassFish
.
DeliveryChannel capable of storing and implementing service qualities, including redelivery, throttling, and message tracking.
, in place of the default DeliveryChannel provided by a component's context.
MessagingChannel channel = new BaseMessagingChannel(componentCtx);
.
Number of visits: 3