Commit 21e2f135 authored by afreyssin's avatar afreyssin
Browse files

DMQ and User creation is no longer a static operation, it use now getWrapper...

DMQ and User creation is no longer a static operation, it use now getWrapper administration wrapper.
parent bde3c1fa
......@@ -97,7 +97,7 @@ public class DeadMQueue extends Queue {
*/
public static Queue create(int serverId, String name) throws ConnectException, AdminException {
DeadMQueue dmq = new DeadMQueue();
doCreate(serverId, name, DEAD_MQUEUE, null, dmq, QUEUE_TYPE);
dmq.doCreate(serverId, name, DEAD_MQUEUE, null, dmq, QUEUE_TYPE);
return dmq;
}
......
......@@ -85,6 +85,15 @@ public class User extends AdministeredObject implements UserMBean {
// Used by jndi2 SoapObjectHelper
public User() {}
/**
* Constructs an <code>User</code> instance.
*
* @param name The name of the user.
*/
public User(String name) {
this.name = name;
}
/**
* Constructs an <code>User</code> instance.
*
......@@ -235,9 +244,10 @@ public class User extends AdministeredObject implements UserMBean {
String identityClassName) throws ConnectException, AdminException {
Identity identity = createIdentity(name, password, identityClassName);
AdminReply reply = AdminModule.doRequest(new CreateUserRequest(identity, serverId));
User user = new User(name, ((CreateUserReply) reply).getProxId());
User user = new User(name);
AdminReply reply = user.getWrapper().doRequest(new CreateUserRequest(identity, serverId));
user.proxyId = ((CreateUserReply) reply).getProxId();
// Be careful, MBean registration is now done explicitly
return user;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment