public static synchronized SecurityConnector getConnector ( FFMQEngineSetup setup ) throws JMSException { if ( connector == null ) { String connectorType = setup . getSecurityConnectorType ( ) ; try { Class < ? > connectorClass = Class . forName ( connectorType ) ; connector = ( SecurityConnector ) connectorClass . getConstructor ( new Class [ ] { Settings . class } ) . newInstance ( new Object [ ] { setup . getSettings ( ) } ) ; } catch ( ClassNotFoundException e ) { throw new FFMQException ( "Security connector class not found : " + connectorType , "SECURITY_ERROR" , e ) ; } catch ( ClassCastException e ) { throw new FFMQException ( "Invalid security connector class : " + connectorType , "SECURITY_ERROR" , e ) ; } catch ( InstantiationException e ) { throw new FFMQException ( "Cannot create security connector" , "SECURITY_ERROR" , e . getCause ( ) ) ; } catch ( InvocationTargetException e ) { throw new FFMQException ( "Cannot create security connector" , "SECURITY_ERROR" , e . getTargetException ( ) ) ; } catch ( Exception e ) { throw new FFMQException ( "Cannot create security connector" , "SECURITY_ERROR" , e ) ; } } return connector ; }
Get the security connector instance