1 17 package org.apache.servicemix.jbi.jmx; 18 19 import org.springframework.beans.factory.FactoryBean; 20 import org.springframework.core.io.Resource; 21 22 27 public class PasswordAuthenticatorFactoryBean implements FactoryBean { 28 29 private Resource passwords; 30 private PasswordAuthenticator authenticator; 31 32 35 public Resource getPasswords() { 36 return passwords; 37 } 38 39 42 public void setPasswords(Resource passwords) { 43 this.passwords = passwords; 44 } 45 46 public Object getObject() throws Exception { 47 if (authenticator == null) { 48 authenticator = new PasswordAuthenticator(passwords.getInputStream()); 49 } 50 return authenticator; 51 } 52 53 public Class getObjectType() { 54 return PasswordAuthenticator.class; 55 } 56 57 public boolean isSingleton() { 58 return true; 59 } 60 61 } 62 | Popular Tags |