//
ContainerFactory containerFactory = new DefaultContainerFactory();
RemoteContainer container = (RemoteContainer)containerFactory.createContainer("jboss4x", ContainerType.REMOTE, cfg);
//
JBossJMXDeployer deployer = new JBossJMXDeployer(container);
execute(deployer);
}