Class BasicComponent

    • Constructor Detail

      • BasicComponent

        public BasicComponent​(BasicComponentCreateService createService)
        Construct a new instance.
        Parameters:
        createService - the create service which created this component
    • Method Detail

      • createInstance

        public ComponentInstance createInstance()
        Create a new instance of this component. This may be invoked by a component interceptor, a client interceptor, or in the course of creating a new client, or in the case of an "eager" singleton, at component start. This method will block until the component is available. If the component fails to start then a runtime exception will be thrown.
        Specified by:
        createInstance in interface Component
        Returns:
        the component instance
      • createInstance

        public ComponentInstance createInstance​(Object instance)
        Wraps an existing object instance in a ComponentInstance, and run the post construct interceptor chain on it.
        Specified by:
        createInstance in interface Component
        Parameters:
        instance - The instance to wrap
        Returns:
        The new ComponentInstance
      • getInstance

        public ComponentInstance getInstance​(Object instance)
        Description copied from interface: Component
        Returns a component instance for a pre-existing instance.
        Specified by:
        getInstance in interface Component
        Parameters:
        instance - the actual object instance
        Returns:
        a component instance
      • constructComponentInstance

        protected BasicComponentInstance constructComponentInstance​(ManagedReference instance,
                                                                    boolean invokePostConstruct)
        Construct the component instance. Upon return, the object instance should have injections and lifecycle invocations completed already.
        Parameters:
        instance - An instance to be wrapped, or null if a new instance should be created
        Returns:
        the component instance
      • constructComponentInstance

        protected BasicComponentInstance constructComponentInstance​(ManagedReference instance,
                                                                    boolean invokePostConstruct,
                                                                    Map<Object,​Object> context)
        Construct the component instance. Upon return, the object instance should have injections and lifecycle invocations completed already.
        Parameters:
        instance - An instance to be wrapped, or null if a new instance should be created
        Returns:
        the component instance
      • componentInstanceCreated

        protected void componentInstanceCreated​(BasicComponentInstance basicComponentInstance)
        Method that can be overridden to perform setup on the instance after it has been created
        Parameters:
        basicComponentInstance - The component instance
      • getComponentClass

        public Class<?> getComponentClass()
        Get the class of this bean component.
        Specified by:
        getComponentClass in interface Component
        Returns:
        the class
      • getComponentName

        public String getComponentName()
        Get the name of this bean component.
        Returns:
        the component name
      • getCreateServiceName

        public org.jboss.msc.service.ServiceName getCreateServiceName()
      • start

        public void start()
        Start operation called when the Component is available.
        Specified by:
        start in interface Component
      • init

        public void init()
      • createInterceptors

        protected void createInterceptors​(org.jboss.invocation.InterceptorFactoryContext context)
      • stop

        public void stop()
        Stop operation called when the Component is no longer available.
        Specified by:
        stop in interface Component
      • serviceNameOf

        public static org.jboss.msc.service.ServiceName serviceNameOf​(org.jboss.msc.service.ServiceName deploymentUnitServiceName,
                                                                      String componentName)