2014-04-08 3 views
2

Liferay 용 서비스 훅을 개발 중이며, 외부 EJB를 사용하여 비즈니스 로직을 수행하고 싶습니다. 빈을 서비스 클래스에 삽입 할 수있는 방법이 있습니까?Liferay hook CDI

public class MyUserService extends UserServiceWrapper { 

    //I want a bean injected 
    @Inject 
    MyBean myBean; 

    public MyUserService(UserService userService) { 
     super(userService); 
    } 

    @Override 
    public User addUserWithWorkflow(/* all kind of parameters */) 
      throws PortalException, SystemException { 
     User user = super.addUserWithWorkflow(/* all parameters passes here //); 

     //do my business logic here 
     myBean.userRegistered(user); 

     return user; 
    } 
} 

이 작업을 수행 할 수있는 방법이 있나요 : 여기

내 코드?

답변

0

빈 이미 AppContext (훅 spring.xml 파일을 사용)에로드 된 경우

Object bean = com.liferay.portal.kernel.bean.PortletBeanLocatorUtil.locate(
     "bean id", "class") 

을 사용할 수 있습니다 당신이 찾고 있던 무엇인가요?