use of com.adaptris.core.CoreException in project interlok by adaptris.
the class JmsConnectionErrorHandler method init.
@Override
public void init() throws CoreException {
super.init();
try {
retrieveConnection(JmsConnection.class).currentConnection().setExceptionListener(this);
inOnException.set(false);
} catch (JMSException e) {
throw new CoreException(e);
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class JmsConsumerImpl method start.
@Override
public void start() throws CoreException {
try {
consumer = createConsumer();
consumer.setMessageListener(this);
} catch (JMSException e) {
throw new CoreException(e);
}
LifecycleHelper.start(messageTranslator);
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class FailoverJmsConnection method initConnection.
/**
* @see com.adaptris.core.AdaptrisConnectionImp#init()
*/
@Override
protected void initConnection() throws CoreException {
boolean connected = false;
int attempts = 0;
while (!connected) {
attempts++;
for (JmsConnection con : connections) {
current = nullifyRetry(con);
try {
current.setConnectionAttempts(1);
registerExceptionListeners(current);
LifecycleHelper.init(current);
super.connection = current.connection;
connected = true;
break;
} catch (CoreException e) {
// Nothing to do
}
}
if (connected == false) {
log.warn("Failed in all attempts to connect to brokers");
if (attempts > connectionAttempts() && connectionAttempts() > -1) {
throw new CoreException("Failed in all attempts to connect to brokers");
} else {
try {
log.info("Failed to connect to all listed brokers, waiting for retry");
Thread.sleep(connectionRetryInterval());
} catch (InterruptedException e2) {
throw new CoreException("Received interrupt before (re)connecting to brokers", e2);
}
}
}
}
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class ChannelManager method initMembers.
private void initMembers() throws MalformedObjectNameException, CoreException {
if (isEmpty(channel.getUniqueId())) {
throw new CoreException("No UniqueID, this channel cannot be managed");
}
// Builds up a name com.adaptris:type=Channel, adapter=<adapter-id,>, id=<channel-id>
myObjectName = ObjectName.getInstance(JMX_CHANNEL_TYPE + ADAPTER_PREFIX + parent.getUniqueId() + ID_PREFIX + getWrappedComponent().getUniqueId());
for (Workflow c : channel.getWorkflowList()) {
if (!isEmpty(c.getUniqueId())) {
addChild(new WorkflowManager(c, this, true), true);
}
}
addChildJmxComponentQuietly((ChildRuntimeInfoComponent) RuntimeInfoComponentFactory.create(this, channel.getMessageErrorHandler()));
marshalConfig();
}
use of com.adaptris.core.CoreException in project interlok by adaptris.
the class ChildRuntimeInfoComponentImpl method registerMBean.
@Override
public void registerMBean() throws CoreException {
try {
ObjectName objName = createObjectName();
log.trace("Registering {} against {}", this.getClass().getName(), objName);
JmxHelper.register(objName, this);
} catch (Exception e) {
throw new CoreException(e);
}
}
Aggregations