use of javax.naming.OperationNotSupportedException in project camel by apache.
the class Jt400Endpoint method createConsumer.
@Override
public Consumer createConsumer(Processor processor) throws Exception {
if (Jt400Type.DTAQ == configuration.getType()) {
Consumer consumer = new Jt400DataQueueConsumer(this, processor);
configureConsumer(consumer);
return consumer;
} else {
throw new OperationNotSupportedException();
}
}
use of javax.naming.OperationNotSupportedException in project tomcat by apache.
the class GlobalResourcesLifecycleListener method createMBeans.
/**
* Create the MBeans for the interesting global JNDI resources in
* the specified naming context.
*
* @param prefix Prefix for complete object name paths
* @param context Context to be scanned
*
* @exception NamingException if a JNDI exception occurs
*/
protected void createMBeans(String prefix, Context context) throws NamingException {
if (log.isDebugEnabled()) {
log.debug("Creating MBeans for Global JNDI Resources in Context '" + prefix + "'");
}
try {
NamingEnumeration<Binding> bindings = context.listBindings("");
while (bindings.hasMore()) {
Binding binding = bindings.next();
String name = prefix + binding.getName();
Object value = context.lookup(binding.getName());
if (log.isDebugEnabled()) {
log.debug("Checking resource " + name);
}
if (value instanceof Context) {
createMBeans(name + "/", (Context) value);
} else if (value instanceof UserDatabase) {
try {
createMBeans(name, (UserDatabase) value);
} catch (Exception e) {
log.error("Exception creating UserDatabase MBeans for " + name, e);
}
}
}
} catch (RuntimeException ex) {
log.error("RuntimeException " + ex);
} catch (OperationNotSupportedException ex) {
log.error("Operation not supported " + ex);
}
}
Aggregations