可以用Jboss的Invoke方法,我写了一个,你看看能不能用 private void deleteTopicInJboss(String topicName) throws Exception {
Hashtable <String, String> jndi = new Hashtable <String, String> ();
jndi.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
jndi.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
jndi.put(Context.PROVIDER_URL, "localhost:1099"); Context context = new InitialContext(jndi);
MBeanServerConnection server = (MBeanServerConnection) context.lookup("jmx/invoker/RMIAdaptor");
server.invoke(new ObjectName("jboss.mq:service=DestinationManager"),
"destroyTopic",
new Object[] {"topic/" + topicName},
new String[] {"java.lang.String"});
}
Hashtable <String, String> jndi = new Hashtable <String, String> ();
jndi.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
jndi.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
jndi.put(Context.PROVIDER_URL, "localhost:1099"); Context context = new InitialContext(jndi);
MBeanServerConnection server = (MBeanServerConnection) context.lookup("jmx/invoker/RMIAdaptor");
server.invoke(new ObjectName("jboss.mq:service=DestinationManager"),
"destroyTopic",
new Object[] {"topic/" + topicName},
new String[] {"java.lang.String"});
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货