directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1336682 - in /directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/server/...
Date Thu, 10 May 2012 13:34:45 GMT
Author: gokturk
Date: Thu May 10 13:34:44 2012
New Revision: 1336682

URL: http://svn.apache.org/viewvc?rev=1336682&view=rev
Log:
Implementation of IPojo connector for ComponentHub,
It works with apacheds-hub-connector-ipojo-handler to wire ApacheDS components into ComponentHub
system.


Added:
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/pom.xml
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/Activator.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoConnector.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoFactoryTracker.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoOperations.java

Added: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/pom.xml?rev=1336682&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/pom.xml (added)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/pom.xml Thu May 10
13:34:44 2012
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory.server</groupId>
+    <artifactId>apacheds-hub-connector-ipojo</artifactId>    
+    <version>2.0.0-M7-SNAPSHOT</version>
+  </parent>
+  <artifactId>apacheds-hub-connector-ipojo-core</artifactId>
+  <name>Component Hub IPojo Connector</name>
+  <description>Component Hub IPojo Connector</description>
+
+  <packaging>bundle</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-hub-api</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-hub-connector-ipojo-handler</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.ipojo</artifactId>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <inherited>true</inherited>
+        <extensions>true</extensions>
+        <configuration>
+          <manifestLocation>META-INF</manifestLocation>
+          <unpackBundle>true</unpackBundle>
+          <instructions>
+            <Bundle-SymbolicName>${project.groupId}.connector.ipojo</Bundle-SymbolicName>
+            <Bundle-Activator>org.apache.directory.server.hub.connector.ipojo.core.Activator</Bundle-Activator>
+            <Export-Package>
+                {local-packages};version=${project.version};-noimport:=true
+            </Export-Package>
+          </instructions>
+        </configuration>
+      </plugin>     
+    </plugins>
+  </build>
+  
+</project>

Added: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/Activator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/Activator.java?rev=1336682&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/Activator.java
(added)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/Activator.java
Thu May 10 13:34:44 2012
@@ -0,0 +1,26 @@
+package org.apache.directory.server.hub.connector.ipojo.core;
+
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+
+public class Activator implements BundleActivator
+{
+    @Override
+    public void start( BundleContext context ) throws Exception
+    {
+        IPojoConnector.connectorContext = context;
+
+        IPojoFactoryTracker tracker = new IPojoFactoryTracker( new IPojoConnector() );
+        tracker.open();
+    }
+
+
+    @Override
+    public void stop( BundleContext context ) throws Exception
+    {
+        IPojoConnector.connectorContext = null;
+    }
+
+}

Added: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java?rev=1336682&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java
(added)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DCMetadataBuilder.java
Thu May 10 13:34:44 2012
@@ -0,0 +1,140 @@
+package org.apache.directory.server.hub.connector.ipojo.core;
+
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.directory.server.component.handler.ipojo.property.DirectoryPropertyDescription;
+import org.apache.directory.server.hub.api.component.util.ComponentConstants;
+import org.apache.directory.server.hub.api.meta.DCMetadataDescriptor;
+import org.apache.directory.server.hub.api.meta.DCPropertyDescription;
+import org.apache.directory.server.hub.api.meta.DCPropertyType;
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.apache.felix.ipojo.metadata.Element;
+import org.osgi.framework.Version;
+
+
+public class DCMetadataBuilder
+{
+    public static DCMetadataDescriptor generateDCMetadata( ComponentFactory factory )
+    {
+        String metadataPID = factory.getName();
+        Version metaVersion = factory.getBundleContext().getBundle().getVersion();
+
+        List<DCPropertyDescription> properties = new ArrayList<DCPropertyDescription>();
+
+        for ( PropertyDescription property : factory.getComponentDescription().getProperties()
)
+        {
+            String name = property.getName();
+            String defaultValue = property.getValue();
+            boolean mandatory = property.isMandatory();
+            String type = normalizeType( property.getType() );
+            String description = "";
+            String containerFor = "";
+
+            DirectoryPropertyDescription dpd = ( DirectoryPropertyDescription ) property;
+            if ( dpd != null )
+            {
+                description = dpd.getDesc();
+                containerFor = normalizeType( dpd.getContainerType() );
+            }
+
+            if ( property.isImmutable() )
+            {
+                properties.add( new DCPropertyDescription( DCPropertyType.CONSTANT, name,
type,
+                    defaultValue, description, mandatory, containerFor ) );
+            }
+            else
+            {
+                properties.add( new DCPropertyDescription( name, type,
+                    defaultValue, description, mandatory, containerFor ) );
+            }
+        }
+
+        ComponentTypeDescription typeDescription = factory.getComponentTypeDescription();
+        Element desc = typeDescription.getDescription();
+
+        String className = desc.getAttribute( "Implementation-Class" );
+
+        Element inheritance = desc.getElements( "Inherited" )[0];
+
+        String interfaces = inheritance.getAttribute( "Interfaces" );
+        String sclasses = inheritance.getAttribute( "SuperClasses" );
+
+        String[] implemented = parseArray( interfaces );
+        String[] extended = parseArray( sclasses );
+
+        DCMetadataDescriptor metadata = new DCMetadataDescriptor( metadataPID, true, metaVersion,
className,
+            implemented, extended, properties.toArray( new DCPropertyDescription[0] ) );
+
+        return metadata;
+    }
+
+
+    private static String[] parseArray( String array )
+    {
+        if ( !( array.contains( "[" ) && array.contains( "]" ) ) )
+        {
+            return new String[0];
+        }
+
+        array = array.substring( 1, array.length() - 1 );
+
+        String[] splitted = array.split( "," );
+
+        return splitted;
+    }
+
+
+    private static String normalizeType( String type )
+    {
+        if ( type.endsWith( "[]" ) )
+        {
+            return Array.class.getName();
+        }
+        else
+        {
+            if ( "string".equals( type ) || "String".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_STR;
+            }
+            else if ( "boolean".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_BOOL;
+            }
+            else if ( "byte".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_INT;
+            }
+            else if ( "short".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_INT;
+            }
+            else if ( "int".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_INT;
+            }
+            else if ( "long".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_INT;
+            }
+            else if ( "float".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_FLOAT;
+            }
+            else if ( "double".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_FLOAT;
+            }
+            else if ( "char".equals( type ) )
+            {
+                return ComponentConstants.PRIMITIVE_INT;
+            }
+            else
+                return type;
+        }
+    }
+}

Added: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoConnector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoConnector.java?rev=1336682&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoConnector.java
(added)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoConnector.java
Thu May 10 13:34:44 2012
@@ -0,0 +1,96 @@
+package org.apache.directory.server.hub.connector.ipojo.core;
+
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.directory.server.hub.api.ComponentHub;
+import org.apache.directory.server.hub.api.HubConnector;
+import org.apache.directory.server.hub.api.component.util.ComponentConstants;
+import org.apache.directory.server.hub.api.exception.HubAbortException;
+import org.apache.directory.server.hub.api.meta.DCMetadataDescriptor;
+import org.apache.directory.server.hub.api.meta.DCOperationsManager;
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.osgi.framework.BundleContext;
+
+
+public class IPojoConnector implements HubConnector
+{
+    public static BundleContext connectorContext;
+
+    private ComponentHub hub;
+
+    private IPojoFactoryTracker tracker;
+
+    private Set<String> managedFactories = new HashSet<String>();
+
+
+    @Override
+    public void init( ComponentHub hub )
+    {
+        if ( connectorContext == null )
+        {
+            //TODO Error log.
+            return;
+        }
+
+        this.hub = hub;
+
+        tracker = new IPojoFactoryTracker( this );
+        tracker.open();
+    }
+
+
+    public void factoryActivated( ComponentFactory factory )
+    {
+        if ( isDirectoryFactory( factory ) )
+        {
+            DCMetadataDescriptor metadata = DCMetadataBuilder.generateDCMetadata( factory
);
+            DCOperationsManager operationsManager = new IPojoOperations( factory );
+
+            try
+            {
+                hub.connectHandler( metadata, operationsManager );
+                managedFactories.add( factory.getName() );
+            }
+            catch ( HubAbortException e )
+            {
+            }
+        }
+    }
+
+
+    public void factoryDeactivating( ComponentFactory factory )
+    {
+        if ( managedFactories.contains( factory.getName() ) )
+        {
+            hub.disconnectHandler( factory.getName() );
+        }
+    }
+
+
+    private boolean isDirectoryFactory( ComponentFactory factory )
+    {
+        PropertyDescription[] properties = factory.getComponentTypeDescription().getProperties();
+
+        for ( PropertyDescription pd : properties )
+        {
+            if ( pd.getName().equals( ComponentConstants.DC_NATURE_INDICATOR ) )
+            {
+                if ( Boolean.parseBoolean( pd.getValue() ) )
+                {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+
+    public BundleContext getContext()
+    {
+        return connectorContext;
+    }
+}

Added: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoFactoryTracker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoFactoryTracker.java?rev=1336682&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoFactoryTracker.java
(added)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoFactoryTracker.java
Thu May 10 13:34:44 2012
@@ -0,0 +1,94 @@
+package org.apache.directory.server.hub.connector.ipojo.core;
+
+
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.FactoryStateListener;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+
+public class IPojoFactoryTracker implements FactoryStateListener, ServiceTrackerCustomizer
+{
+    BundleContext context;
+    ServiceTracker tracker;
+    IPojoConnector connector;
+
+
+    public IPojoFactoryTracker( IPojoConnector connector )
+    {
+        this.connector = connector;
+        context = connector.getContext();
+
+        tracker = new ServiceTracker( context, Factory.class.getName(), this );
+    }
+
+
+    public void open()
+    {
+        tracker.open();
+    }
+
+
+    public void close()
+    {
+        tracker.close();
+    }
+
+
+    @Override
+    public void stateChanged( Factory factory, int state )
+    {
+        ComponentFactory componentFactory = ( ComponentFactory ) factory;
+
+        if ( state == Factory.VALID )
+        {
+            connector.factoryActivated( componentFactory );
+        }
+        else if ( state == Factory.INVALID )
+        {
+            connector.factoryDeactivating( componentFactory );
+        }
+
+    }
+
+
+    @Override
+    public Object addingService( ServiceReference reference )
+    {
+        Factory factory = context.getService( ( ServiceReference<Factory> ) reference
);
+
+        ComponentFactory componentFactory = ( ComponentFactory ) factory;
+        if ( componentFactory == null )
+        {
+            return null;
+        }
+        
+        System.out.println(factory.getName()+"adding");
+
+        componentFactory.addFactoryStateListener( this );
+
+        if ( componentFactory.getState() == Factory.VALID )
+        {
+            connector.factoryActivated( componentFactory );
+        }
+
+        return reference;
+
+    }
+
+
+    @Override
+    public void modifiedService( ServiceReference reference, Object service )
+    {
+    }
+
+
+    @Override
+    public void removedService( ServiceReference reference, Object service )
+    {
+    }
+
+}

Added: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoOperations.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoOperations.java?rev=1336682&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoOperations.java
(added)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/IPojoOperations.java
Thu May 10 13:34:44 2012
@@ -0,0 +1,126 @@
+package org.apache.directory.server.hub.connector.ipojo.core;
+
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.directory.server.hub.api.component.DCProperty;
+import org.apache.directory.server.hub.api.component.DCRuntime;
+import org.apache.directory.server.hub.api.component.DirectoryComponent;
+import org.apache.directory.server.hub.api.exception.ComponentInstantiationException;
+import org.apache.directory.server.hub.api.exception.ComponentReconfigurationException;
+import org.apache.directory.server.hub.api.meta.DCOperationsManager;
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.MissingHandlerException;
+import org.apache.felix.ipojo.UnacceptableConfiguration;
+
+
+public class IPojoOperations implements DCOperationsManager
+{
+
+    private ComponentFactory factory;
+
+
+    public IPojoOperations( ComponentFactory factory )
+    {
+        this.factory = factory;
+    }
+
+
+    @Override
+    public void instantiateComponent( DirectoryComponent component ) throws ComponentInstantiationException
+    {
+        Dictionary<String, Object> configuration = new Hashtable<String, Object>();
+        for ( DCProperty prop : component.getConfiguration() )
+        {
+            configuration.put( prop.getName(), prop.getObject() );
+        }
+
+        configuration.put( "instance.name", component.getComponentPID() );
+
+        try
+        {
+            ComponentInstance instance = factory.createComponentInstance( configuration );
+
+            InstanceManager manager = ( InstanceManager ) instance;
+            Object pojo = manager.getPojoObject();
+
+            component.setRuntimeInfo( new DCRuntime( manager, pojo ) );
+        }
+        catch ( UnacceptableConfiguration e )
+        {
+            throw new ComponentInstantiationException( "Configuration unacceptable for component"
+                + component.getComponentPID(), e );
+        }
+        catch ( MissingHandlerException e )
+        {
+            throw new ComponentInstantiationException( "Missing handler for component:" +
component.getComponentPID(),
+                e );
+        }
+        catch ( ConfigurationException e )
+        {
+            throw new ComponentInstantiationException( "Configuration failed for component:"
+                + component.getComponentPID(), e );
+        }
+    }
+
+
+    @Override
+    public void reconfigureComponent( DirectoryComponent component ) throws ComponentReconfigurationException
+    {
+        DCRuntime runtime = component.getRuntimeInfo();
+        if ( runtime == null || runtime.getSpecialObject() == null )
+        {
+            throw new ComponentReconfigurationException( "Failed to reconfigure disposed
component:"
+                + component.getComponentPID() );
+        }
+
+        InstanceManager manager = ( InstanceManager ) runtime.getSpecialObject();
+
+        if ( manager.getState() != InstanceManager.VALID )
+        {
+            throw new ComponentReconfigurationException( "Failed to reconfigure disactivated
component:"
+                + component.getComponentPID() );
+        }
+
+        Dictionary<String, Object> configuration = new Hashtable<String, Object>();
+        for ( DCProperty prop : component.getConfiguration() )
+        {
+            configuration.put( prop.getName(), prop.getObject() );
+        }
+
+        configuration.put( "instance.name", component.getComponentPID() );
+
+        manager.reconfigure( configuration );
+
+        if ( manager.getState() != InstanceManager.VALID )
+        {
+            throw new ComponentReconfigurationException( "Reconfiguration stopped the component:"
+                + component.getComponentPID() );
+        }
+    }
+
+
+    @Override
+    public void disposeComponent( DirectoryComponent component )
+    {
+        DCRuntime runtime = component.getRuntimeInfo();
+        if ( runtime == null || runtime.getSpecialObject() == null )
+        {
+            component.setRuntimeInfo( null );
+            return;
+        }
+
+        InstanceManager manager = ( InstanceManager ) runtime.getSpecialObject();
+        if ( manager.getState() != InstanceManager.DISPOSED )
+        {
+            manager.dispose();
+        }
+
+        component.setRuntimeInfo( null );
+    }
+
+}



Mime
View raw message