Code example for Subject

Methods: getPrincipals, getPrivateCredentials

0
		boolean commitValue = super.commit();
 
		if (commitValue) {
			Subject subject = getSubject();
 
			Set<Principal> principals = subject.getPrincipals();
 
			principals.add(getPrincipal());
 
			Set<Object> privateCredentials = subject.getPrivateCredentials();
 
			privateCredentials.add(getPassword());
 
			try { 
				Principal group = (Principal)InstanceFactory.newInstance(
					_JGROUP, String.class, "Roles");
				Object role = InstanceFactory.newInstance(
					_JROLE, String.class, "users");
 
				Method method = MethodCache.get(
					_JGROUP, "addMember", new Class[] {role.getClass()});