public SessionServer(EjbContainer manager, AnnotatedType<T> annotatedType)
{
super(manager, annotatedType);
DeclareRoles declareRoles
= annotatedType.getJavaClass().getAnnotation(DeclareRoles.class);
RolesAllowed rolesAllowed
= annotatedType.getJavaClass().getAnnotation(RolesAllowed.class);
if (declareRoles != null && rolesAllowed != null) {
_declaredRoles = new String[declareRoles.value().length +
rolesAllowed.value().length];
System.arraycopy(declareRoles.value(), 0,
_declaredRoles, 0,
declareRoles.value().length);
System.arraycopy(rolesAllowed.value(), 0,
_declaredRoles, declareRoles.value().length,
rolesAllowed.value().length);
}
else if (declareRoles != null) {
_declaredRoles = declareRoles.value();
}
else if (rolesAllowed != null) {
_declaredRoles = rolesAllowed.value();
}
}