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


Java SimpleAuthenticationPlugin.setAnonymousAccessAllowed方法代码示例

本文整理汇总了Java中org.apache.activemq.security.SimpleAuthenticationPlugin.setAnonymousAccessAllowed方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleAuthenticationPlugin.setAnonymousAccessAllowed方法的具体用法?Java SimpleAuthenticationPlugin.setAnonymousAccessAllowed怎么用?Java SimpleAuthenticationPlugin.setAnonymousAccessAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.security.SimpleAuthenticationPlugin的用法示例。


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

示例1: configureAuthentication

import org.apache.activemq.security.SimpleAuthenticationPlugin; //导入方法依赖的package包/类
protected BrokerPlugin configureAuthentication() throws Exception {
  List<AuthenticationUser> users = new ArrayList<AuthenticationUser>();
  users.add(new AuthenticationUser(USERNAME_ADMIN, PASSWORD_ADMIN, "users,admins"));
  users.add(new AuthenticationUser(USERNAME_USER, PASSWORD_USER, "users"));
  users.add(new AuthenticationUser(USERNAME_GUEST, PASSWORD_GUEST, "guests"));
  SimpleAuthenticationPlugin authenticationPlugin = new SimpleAuthenticationPlugin(users);
  authenticationPlugin.setAnonymousAccessAllowed(isAnonymousAccessAllowed());

  return authenticationPlugin;
}
 
开发者ID:vert-x3,项目名称:vertx-amqp-bridge,代码行数:11,代码来源:ActiveMQTestBase.java

示例2: configureAuthentication

import org.apache.activemq.security.SimpleAuthenticationPlugin; //导入方法依赖的package包/类
protected BrokerPlugin configureAuthentication() throws Exception {
    List<AuthenticationUser> users = new ArrayList<AuthenticationUser>();
    users.add(new AuthenticationUser("system", "manager", "users,admins"));
    users.add(new AuthenticationUser("user", "password", "users"));
    users.add(new AuthenticationUser("guest", "password", "guests"));
    SimpleAuthenticationPlugin authenticationPlugin = new SimpleAuthenticationPlugin(users);
    authenticationPlugin.setAnonymousAccessAllowed(true);

    return authenticationPlugin;
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:11,代码来源:QpidJmsTestSupport.java

示例3: start

import org.apache.activemq.security.SimpleAuthenticationPlugin; //导入方法依赖的package包/类
public Broker start() {
    LOGGER.info("Starting broker using brokerURL: [" + brokerURL + "]");

    try {
        broker = new BrokerService();
        broker.setPersistent(false);
        broker.deleteAllMessages();
        broker.setDeleteAllMessagesOnStartup(true);
        broker.setUseJmx(false);
        broker.getSystemUsage().getTempUsage().setLimit(USAGE_LIMIT);
        broker.getSystemUsage().getStoreUsage().setLimit(USAGE_LIMIT);
        broker.addConnector(brokerURL);

        if (username != null) {
            AuthenticationUser user = new AuthenticationUser(username, password, "producers,consumer");
            SimpleAuthenticationPlugin authenticationPlugin = new SimpleAuthenticationPlugin();
            authenticationPlugin.setAnonymousAccessAllowed(false);
            authenticationPlugin.setUsers(singletonList(user));
            broker.setPlugins(new BrokerPlugin[]{authenticationPlugin});
        }

        broker.start();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }

    LOGGER.info("Successfully started broker");
    return this;
}
 
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:30,代码来源:Broker.java


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