Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
  * regarding copyright ownership.  The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
Provides introspection functions for Spring beans This version leans heavily on the implementation-java classes

$Rev: 987670 $ $Date: 2010-08-21 00:42:07 +0100 (Sat, 21 Aug 2010) $
public class SpringBeanIntrospector {
The constructor sets up the various visitor elements that will be used to introspect the Spring bean and extract SCA information.

assemblyFactory The Assembly Factory to use
javaFactory The Java Interface Factory to use
policyFactory The Policy Factory to use.
        FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
    } // end constructor 

Introspect a Spring Bean and extract the features important to SCA

beanClass the Spring Bean class to introspect
componentType the componentType that is filled in through the introspection process (assumed empty on invocation, filled on return
a Map of property names to JavaElementImpl
Throws: - if there was a problem resolving the Spring Bean or its componentType
    public JavaImplementation introspectBean(Class<?> beanClassComponentType componentType)
        throws ContributionResolveException {
        if (componentType == null)
            throw new ContributionResolveException("Introspect Spring bean: supplied componentType is null");
        // Create a Java implementation ready for the introspection
        // Set the type to be implementation.spring to avoid heuristic introspection
        try {
            // Introspect the bean...the results of the introspection are placed into the Java implementation
            // Extract the services, references & properties found through introspection
            // put the services, references and properties into the component type
        } catch (IntrospectionException e) {
            throw new ContributionResolveException(e);
        } // end try
        return javaImplementation;
    } // end method introspectBean
// end class SpringBeanIntrospector
New to GrepCode? Check out our FAQ X