当前位置: 首页>>代码示例>>Java>>正文


Java MessageAuthorizationPolicy类代码示例

本文整理汇总了Java中org.apache.activemq.security.MessageAuthorizationPolicy的典型用法代码示例。如果您正苦于以下问题:Java MessageAuthorizationPolicy类的具体用法?Java MessageAuthorizationPolicy怎么用?Java MessageAuthorizationPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageAuthorizationPolicy类属于org.apache.activemq.security包,在下文中一共展示了MessageAuthorizationPolicy类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBroker

import org.apache.activemq.security.MessageAuthorizationPolicy; //导入依赖的package包/类
@Override
protected BrokerService createBroker() throws Exception {
   BrokerService answer = new BrokerService();
   answer.setPersistent(false);
   answer.setMessageAuthorizationPolicy(new MessageAuthorizationPolicy() {
      @Override
      public boolean isAllowedToConsume(ConnectionContext context, Message message) {
         try {
            Object value = message.getProperty("myHeader");
            return "abc".equals(value);
         } catch (IOException e) {
            System.out.println("Caught: " + e);
            e.printStackTrace();
            return false;
         }
      }
   });
   answer.addConnector(bindAddress);
   return answer;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:21,代码来源:MessageAuthenticationTest.java

示例2: startTransportConnector

import org.apache.activemq.security.MessageAuthorizationPolicy; //导入依赖的package包/类
protected TransportConnector startTransportConnector(TransportConnector connector) throws Exception {
    connector.setTaskRunnerFactory(getTaskRunnerFactory());
    MessageAuthorizationPolicy policy = getMessageAuthorizationPolicy();
    if (policy != null) {
        connector.setMessageAuthorizationPolicy(policy);
    }
    if (isUseJmx()) {
        connector = registerConnectorMBean(connector);
    }
    connector.getStatistics().setEnabled(enableStatistics);
    connector.start();
    return connector;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:BrokerService.java

示例3: getMessageAuthorizationPolicy

import org.apache.activemq.security.MessageAuthorizationPolicy; //导入依赖的package包/类
public MessageAuthorizationPolicy getMessageAuthorizationPolicy() {
    return messageAuthorizationPolicy;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:4,代码来源:TransportConnection.java

示例4: setMessageAuthorizationPolicy

import org.apache.activemq.security.MessageAuthorizationPolicy; //导入依赖的package包/类
public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) {
    this.messageAuthorizationPolicy = messageAuthorizationPolicy;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:4,代码来源:TransportConnection.java

示例5: setMessageAuthorizationPolicy

import org.apache.activemq.security.MessageAuthorizationPolicy; //导入依赖的package包/类
public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) {
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:3,代码来源:BrokerService.java

示例6: setMessageAuthorizationPolicy

import org.apache.activemq.security.MessageAuthorizationPolicy; //导入依赖的package包/类
/**
 * Sets the policy used to decide if the current connection is authorized to
 * consume a given message
 */
public void setMessageAuthorizationPolicy(MessageAuthorizationPolicy messageAuthorizationPolicy) {
    this.messageAuthorizationPolicy = messageAuthorizationPolicy;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:8,代码来源:ConnectionContext.java


注:本文中的org.apache.activemq.security.MessageAuthorizationPolicy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。