2017-05-29 7 views
0

私はliferay 6.1で働いていたときに、メッセージを受け取ったアプリケーションを作成しました。Liferay 7 MessageListener osgiモジュール

Javaクラス:

public class MailMessageBus implements MessageListener 

\ SRC \メイン\のWebアプリケーションの\ WEB-INF \ SRC \ META-INF \メッセージング・spring.xmlファイル:

<beans 
default-destroy-method="destroy" 
default-init-method="afterPropertiesSet" 
xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> 

<!-- Root Context: defines shared resources visible to all other web components --> 
<bean id="messagingConfigurator" class="com.liferay.portal.kernel.messaging.config.PluginMessagingConfigurator"> 
    <property name="messageListeners"> 
     <map key-type="java.lang.String" value-type="java.util.List"> 
      <entry key="mail-send-message"> 
       <list value-type="com.liferay.portal.kernel.messaging.MessageListener"> 
        <ref bean="messageListener.mail_listener" /> 
       </list> 
      </entry> 
     </map> 
    </property> 
    <property name="destinations"> 
     <list> 
      <ref bean="destination.mail"/> 
     </list> 
    </property> 

</bean> 

<!-- Destination class --> 
<bean id="destination.mail" class="com.liferay.portal.kernel.messaging.ParallelDestination"> 
     <property name="name" value="mail-send-message" /> 
</bean> 
<!-- Listener class --> 
<bean id="messageListener.mail_listener" class="customportlet.AMessageBusListener.MailMessageBus" /> 

と\ src \ main \ webapp \ WEB-INF \ web.xmlファイル:

... 
<context-param> 
    <param-name>portalContextConfigLocation</param-name> 
    <param-value>/WEB-INF/src/META-INF/messaging-spring.xml</param-value> 
</context-param> 
... 

OSGiモジュールでliferay 7を実行するにはどうすればよいですか? OSGiモジュールにはweb.xmlファイルがありません。 ありがとうございます!

+0

にあるXMLファイル内に設定を入れて、あなたが解決策を見つけますか? –

答えて

関連する問題