本文整理汇总了Java中javax.interceptor.Interceptors类的典型用法代码示例。如果您正苦于以下问题:Java Interceptors类的具体用法?Java Interceptors怎么用?Java Interceptors使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Interceptors类属于javax.interceptor包,在下文中一共展示了Interceptors类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCategories
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public List<Category> getCategories() {
if (categories != null) {
return categories;
}
synchronized (this) {
if (categories != null) {
return categories;
}
try {
int forumInstanceId = 1;
categories = forumsModule.findCategoriesFetchForums(forumInstanceId);
return categories;
} catch (Exception e) {
handleException(e);
}
return null;
}
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:23,代码来源:ViewAdminPanel.java
示例2: getForums
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public List<Forum> getForums() {
if (forums != null) {
return forums;
}
try {
int forumInstanceId = 1;
forums = forumsModule.findForums(forumInstanceId);
return forums;
} catch (Exception e) {
handleException(e);
}
return null;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:18,代码来源:ViewAdminPanel.java
示例3: addCategory
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public String addCategory() {
String navState = null;
boolean success = false;
try {
int forumInstanceId = 1;
ForumInstance forumInstance = forumsModule.findForumInstanceById(forumInstanceId);
forumsModule.createCategory(categoryName, forumInstance);
String start = getBundleMessage("ResourceJSF", "Category_created_0");
String end = getBundleMessage("ResourceJSF", "Category_created_1");
setMessage(FEEDBACK, start + " \"" + categoryName + "\" " + end);
success = true;
} catch (Exception e) {
handleException(e);
} finally {
if (success) {
cleanup();
}
}
return navState;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:26,代码来源:AdminController.java
示例4: resetPasswordForUser
import javax.interceptor.Interceptors; //导入依赖的package包/类
@Override
@RolesAllowed("PLATFORM_OPERATOR")
@Interceptors({ ServiceProviderInterceptor.class })
public void resetPasswordForUser(String userId)
throws ObjectNotFoundException, OperationNotPermittedException,
MailOperationException, OrganizationAuthoritiesException {
// retrieve the platform user
PlatformUser user = new PlatformUser();
user.setUserId(userId);
user = (PlatformUser) dm.getReferenceByBusinessKey(user);
// reset the password, no marketplace context available
im.resetPasswordForUser(user, null);
}
示例5: requestResetOfUserPassword
import javax.interceptor.Interceptors; //导入依赖的package包/类
@Override
@RolesAllowed("ORGANIZATION_ADMIN")
@Interceptors({ ServiceProviderInterceptor.class })
public void requestResetOfUserPassword(VOUser user, String marketplaceId)
throws MailOperationException, ObjectNotFoundException,
OperationNotPermittedException, UserActiveException,
ConcurrentModificationException {
ArgumentValidator.notNull("user", user);
PlatformUser platformUser = getPlatformUser(user.getUserId(),
user.getTenantId(), true);
BaseAssembler.verifyVersionAndKey(platformUser, user);
resetUserPassword(platformUser, marketplaceId);
}
示例6: executeUpdateQuery
import javax.interceptor.Interceptors; //导入依赖的package包/类
@Override
@Interceptors({ CibetContextInterceptor.class })
public EventResult executeUpdateQuery(String qn, Object... objects) {
log.debug("execute query: " + qn);
Context.requestScope().setScheduledDate(Calendar.SECOND, 3);
Query q = em.createNativeQuery(qn);
int i = 1;
for (Object ob : objects) {
q.setParameter(i, ob);
i++;
}
q.executeUpdate();
EventResult ev = Context.requestScope().getExecutedEventResult();
return ev;
}
示例7: getListOfPermissions
import javax.interceptor.Interceptors; //导入依赖的package包/类
@GET
@Produces(APPLICATION_JSON)
@Interceptors(PermissionInterceptor.class)
@RequiresPermission(value = PermissionName.TOKEN, action = READ)
public Response getListOfPermissions() {
String username = UserAuthContextHolder.get().getUsername();
User user = authenticationService.getAuthenticatedUser(username);
if (user == null) {
throw new NotAuthorizedException("User not found.");
}
Map<String, Object> responseMap = new HashMap<>();
responseMap.put("permissions", permissionService.getPermissionsForUser(user.getLogin()));
responseMap.put("user", user);
return Response.ok(responseMap).build();
}
示例8: identifyInterceptors
import javax.interceptor.Interceptors; //导入依赖的package包/类
/**
* Identifies and caches {@link Interceptors} annotation data
*
* @throws IOException
*/
private void identifyInterceptors(Class<?> beanClass) throws IOException {
Interceptors interceptors = beanClass.getAnnotation(Interceptors.class);
if (ObjectUtils.notNull(interceptors)) {
cacheInterceptors(interceptors, beanClass);
}
List<Method> beanMethods = ClassUtils.getAnnotatedMethods(beanClass, Interceptors.class);
if (CollectionUtils.valid(beanMethods)) {
for (Method beanMethod : beanMethods) {
interceptors = beanMethod.getAnnotation(Interceptors.class);
cacheInterceptors(interceptors, beanClass, beanMethod);
}
}
}
示例9: getCategories
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public Collection<Category> getCategories() {
if (categories == null) {
categories = new ArrayList<Category>();
}
return categories;
}
示例10: getForums
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public Map<Integer, Collection<Forum>> getForums() {
if (forums == null) {
forums = new HashMap<Integer, Collection<Forum>>();
}
return forums;
}
示例11: getForumImageDescriptions
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public Map<Integer, String> getForumImageDescriptions() {
if (forumImageDescriptions == null) {
forumImageDescriptions = new HashMap<Integer, String>();
}
return forumImageDescriptions;
}
示例12: getForumImages
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public Map<Integer, String> getForumImages() {
if (forumImages == null) {
forumImages = new HashMap<Integer, String>();
}
return forumImages;
}
示例13: getLastPostSubject
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public String getLastPostSubject(int id) {
Post post = getForumLastPosts().get(id);
if (post != null) {
String subject = post.getMessage().getSubject();
return truncate(subject, 25);
} else
return "";
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:11,代码来源:ViewCategory.java
示例14: editCategory
import javax.interceptor.Interceptors; //导入依赖的package包/类
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public String editCategory() {
String navState = null;
boolean success = false;
try {
int categoryId = -1;
String cour = ForumUtil.getParameter(p_categoryId);
if (cour != null && cour.trim().length() > 0) {
categoryId = Integer.parseInt(cour);
}
Category category = forumsModule.findCategoryById(categoryId);
category.setTitle(categoryName);
forumsModule.update(category);
String start = getBundleMessage("ResourceJSF", "Category_updated_0");
String end = getBundleMessage("ResourceJSF", "Category_updated_1");
setMessage(FEEDBACK, start + " \"" + categoryName + "\" " + end);
navState = "";
success = true;
} catch (Exception e) {
handleException(e);
} finally {
if (success) {
cleanup();
}
}
return navState;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:32,代码来源:AdminController.java
示例15: timeout
import javax.interceptor.Interceptors; //导入依赖的package包/类
@Timeout
@Interceptors(ExcludingInterceptor.class)
private void timeout(Timer timer) {
timerServiceCalled = true;
interceptorResults += "@Timeout";
latch.countDown();
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:8,代码来源:ItemServiceBean.java