public void associateTypeJndiResource ( JNDIResourceModel resource , String type ) { if ( type == null || resource == null ) { return ; } if ( StringUtils . equals ( type , "javax.sql.DataSource" ) && ! ( resource instanceof DataSourceModel ) ) { DataSourceModel ds = GraphService . addTypeToModel ( this . getGraphContext ( ) , resource , DataSourceModel . class ) ; } else if ( StringUtils . equals ( type , "javax.jms.Queue" ) && ! ( resource instanceof JmsDestinationModel ) ) { JmsDestinationModel jms = GraphService . addTypeToModel ( this . getGraphContext ( ) , resource , JmsDestinationModel . class ) ; jms . setDestinationType ( JmsDestinationType . QUEUE ) ; } else if ( StringUtils . equals ( type , "javax.jms.QueueConnectionFactory" ) && ! ( resource instanceof JmsConnectionFactoryModel ) ) { JmsConnectionFactoryModel jms = GraphService . addTypeToModel ( this . getGraphContext ( ) , resource , JmsConnectionFactoryModel . class ) ; jms . setConnectionFactoryType ( JmsDestinationType . QUEUE ) ; } else if ( StringUtils . equals ( type , "javax.jms.Topic" ) && ! ( resource instanceof JmsDestinationModel ) ) { JmsDestinationModel jms = GraphService . addTypeToModel ( this . getGraphContext ( ) , resource , JmsDestinationModel . class ) ; jms . setDestinationType ( JmsDestinationType . TOPIC ) ; } else if ( StringUtils . equals ( type , "javax.jms.TopicConnectionFactory" ) && ! ( resource instanceof JmsConnectionFactoryModel ) ) { JmsConnectionFactoryModel jms = GraphService . addTypeToModel ( this . getGraphContext ( ) , resource , JmsConnectionFactoryModel . class ) ; jms . setConnectionFactoryType ( JmsDestinationType . TOPIC ) ; } }
Associate a type with the given resource model .