Search in sources :

Example 1 with UserCredentialsDistributionTransportSecretMBean

use of org.apache.sling.distribution.monitor.impl.UserCredentialsDistributionTransportSecretMBean in project sling by apache.

the class UserCredentialsDistributionTransportSecretProvider method activate.

@Activate
protected void activate(BundleContext context, Map<String, Object> config) {
    username = PropertiesUtil.toString(config.get(USERNAME), "").trim();
    password = PropertiesUtil.toString(config.get(PASSWORD), "").trim();
    String id = String.valueOf(username.hashCode());
    Dictionary<String, String> mbeanProps = new Hashtable<String, String>();
    mbeanProps.put("jmx.objectname", "org.apache.sling.distribution:type=transport,id=" + ObjectName.quote(id));
    UserCredentialsDistributionTransportSecretMBean mbean = new UserCredentialsDistributionTransportSecretMBeanImpl(username);
    mbeanServiceRegistration = context.registerService(UserCredentialsDistributionTransportSecretMBean.class.getName(), mbean, mbeanProps);
}
Also used : UserCredentialsDistributionTransportSecretMBean(org.apache.sling.distribution.monitor.impl.UserCredentialsDistributionTransportSecretMBean) Hashtable(java.util.Hashtable) UserCredentialsDistributionTransportSecretMBeanImpl(org.apache.sling.distribution.monitor.impl.UserCredentialsDistributionTransportSecretMBeanImpl) Activate(org.apache.felix.scr.annotations.Activate)

Aggregations

Hashtable (java.util.Hashtable)1 Activate (org.apache.felix.scr.annotations.Activate)1 UserCredentialsDistributionTransportSecretMBean (org.apache.sling.distribution.monitor.impl.UserCredentialsDistributionTransportSecretMBean)1 UserCredentialsDistributionTransportSecretMBeanImpl (org.apache.sling.distribution.monitor.impl.UserCredentialsDistributionTransportSecretMBeanImpl)1