mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 23:25:26 +02:00
[178599] public interfaces can't import private interfaces (external loader)
This commit is contained in:
parent
daf29802eb
commit
c55eb2c711
7 changed files with 51 additions and 17 deletions
|
@ -26,9 +26,9 @@ import org.eclipse.dstore.core.model.DataStore;
|
|||
import org.eclipse.dstore.core.model.DataStoreResources;
|
||||
import org.eclipse.dstore.core.model.DataStoreSchema;
|
||||
import org.eclipse.dstore.core.model.Handler;
|
||||
import org.eclipse.dstore.core.model.IExternalLoader;
|
||||
import org.eclipse.dstore.core.model.ISchemaExtender;
|
||||
import org.eclipse.dstore.internal.core.util.ExternalLoader;
|
||||
|
||||
|
||||
/**
|
||||
* Miner is the abstact base class of all DataStore extensions).
|
||||
* The DataStore framework knows how to load and route commands to miners
|
||||
|
@ -49,7 +49,7 @@ implements ISchemaExtender
|
|||
|
||||
private boolean _initialized;
|
||||
private boolean _connected;
|
||||
private ExternalLoader _loader;
|
||||
private IExternalLoader _loader;
|
||||
|
||||
protected String _name = null;
|
||||
protected String _value = null;
|
||||
|
@ -190,7 +190,7 @@ implements ISchemaExtender
|
|||
if (_value == null)
|
||||
{
|
||||
String name = getMinerName();
|
||||
int indexOfValue = name.lastIndexOf("."); //$NON-NLS-1$
|
||||
int indexOfValue = name.lastIndexOf("."); //$NON-NLS-1$
|
||||
_value = name.substring(indexOfValue + 1, name.length());
|
||||
}
|
||||
return _value;
|
||||
|
@ -631,12 +631,12 @@ implements ISchemaExtender
|
|||
return _dataStore.getDescriptorRoot();
|
||||
}
|
||||
|
||||
public void setExternalLoader(ExternalLoader loader)
|
||||
public void setExternalLoader(IExternalLoader loader)
|
||||
{
|
||||
_loader = loader;
|
||||
}
|
||||
|
||||
public ExternalLoader getExternalLoader()
|
||||
public IExternalLoader getExternalLoader()
|
||||
{
|
||||
return _loader;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2007 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Initial Contributors:
|
||||
* The following IBM employees contributed to the Remote System Explorer
|
||||
* component that contains this file: David McKnight.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
********************************************************************************/
|
||||
package org.eclipse.dstore.core.model;
|
||||
|
||||
public interface IExternalLoader {
|
||||
|
||||
|
||||
/**
|
||||
* Indicates whether this external loader can load a particular class
|
||||
* @param source a qualified classname
|
||||
* @return true if it can load the clas
|
||||
*/
|
||||
public boolean canLoad(String source);
|
||||
|
||||
/**
|
||||
* Loads the specified class
|
||||
* @param source a qualified classname
|
||||
* @return the loaded class
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
public Class loadClass(String source) throws ClassNotFoundException;
|
||||
|
||||
}
|
|
@ -17,7 +17,6 @@
|
|||
package org.eclipse.dstore.core.model;
|
||||
|
||||
|
||||
import org.eclipse.dstore.internal.core.util.ExternalLoader;
|
||||
|
||||
/**
|
||||
* ISchemaExtender describes the interfaces that tool extensions
|
||||
|
@ -45,5 +44,5 @@ public interface ISchemaExtender
|
|||
*
|
||||
* @return the external loader
|
||||
*/
|
||||
public abstract ExternalLoader getExternalLoader();
|
||||
public abstract IExternalLoader getExternalLoader();
|
||||
}
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.eclipse.dstore.core.model;
|
||||
|
||||
import org.eclipse.dstore.internal.core.util.ExternalLoader;
|
||||
|
||||
/**
|
||||
* ISchemaRegistry describes the interface that needs to be
|
||||
|
@ -42,9 +41,9 @@ public interface ISchemaRegistry
|
|||
public void extendSchema(DataStore dataStore);
|
||||
|
||||
/**
|
||||
* Returns an <code>ExternalLoader</code> for the specified qualified class name
|
||||
* Returns an <code>IExternalLoader</code> for the specified qualified class name
|
||||
* @param qualifiedClassName the qualified class name of an external tool
|
||||
* @return the external loader that can load to specified class
|
||||
*/
|
||||
public ExternalLoader getLoaderFor(String qualifiedClassName);
|
||||
public IExternalLoader getLoaderFor(String qualifiedClassName);
|
||||
}
|
|
@ -20,9 +20,9 @@ import java.util.ArrayList;
|
|||
|
||||
import org.eclipse.dstore.core.model.DataElement;
|
||||
import org.eclipse.dstore.core.model.DataStore;
|
||||
import org.eclipse.dstore.core.model.IExternalLoader;
|
||||
import org.eclipse.dstore.core.model.ISchemaExtender;
|
||||
import org.eclipse.dstore.core.model.ISchemaRegistry;
|
||||
import org.eclipse.dstore.internal.core.util.ExternalLoader;
|
||||
|
||||
/**
|
||||
* SchemaRegistry implements the interface for external tools to contribute their
|
||||
|
@ -79,12 +79,12 @@ public class SchemaRegistry implements ISchemaRegistry
|
|||
* @param source the qualified classname
|
||||
* @return the external loader for the specified classname
|
||||
*/
|
||||
public ExternalLoader getLoaderFor(String source)
|
||||
public IExternalLoader getLoaderFor(String source)
|
||||
{
|
||||
for (int i = 0; i < _extenders.size(); i++)
|
||||
{
|
||||
ISchemaExtender extender = (ISchemaExtender) _extenders.get(i);
|
||||
ExternalLoader loader = extender.getExternalLoader();
|
||||
IExternalLoader loader = extender.getExternalLoader();
|
||||
if (loader.canLoad(source))
|
||||
{
|
||||
return loader;
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.eclipse.dstore.core.model.DE;
|
|||
import org.eclipse.dstore.core.model.DataElement;
|
||||
import org.eclipse.dstore.core.model.DataStore;
|
||||
import org.eclipse.dstore.core.model.DataStoreAttributes;
|
||||
import org.eclipse.dstore.core.model.IExternalLoader;
|
||||
import org.eclipse.dstore.core.model.ISchemaExtender;
|
||||
import org.eclipse.dstore.core.model.ISchemaRegistry;
|
||||
import org.eclipse.dstore.internal.core.util.ExternalLoader;
|
||||
|
@ -190,7 +191,7 @@ public class MinerLoader implements ISchemaRegistry
|
|||
// only load new miners
|
||||
try
|
||||
{
|
||||
ExternalLoader loader = getLoaderFor(name);
|
||||
IExternalLoader loader = getLoaderFor(name);
|
||||
if (loader != null)
|
||||
{
|
||||
// try to load and instantiate the miner
|
||||
|
@ -334,7 +335,7 @@ public class MinerLoader implements ISchemaRegistry
|
|||
* @param source a qualified classname
|
||||
* @return the loader for the specified class
|
||||
*/
|
||||
public ExternalLoader getLoaderFor(String source)
|
||||
public IExternalLoader getLoaderFor(String source)
|
||||
{
|
||||
ExternalLoader remoteLoader = getExternalRemoteLoader();
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.eclipse.dstore.internal.core.util;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.dstore.core.java.RemoteClassLoader;
|
||||
import org.eclipse.dstore.core.model.IExternalLoader;
|
||||
import org.eclipse.dstore.core.util.StringCompare;
|
||||
|
||||
|
||||
|
@ -28,7 +29,7 @@ import org.eclipse.dstore.core.util.StringCompare;
|
|||
* contains a <i>load scope</i>, a list of classpaths that it's class loader is able
|
||||
* to load.
|
||||
*/
|
||||
public class ExternalLoader
|
||||
public class ExternalLoader implements IExternalLoader
|
||||
{
|
||||
|
||||
private ClassLoader _classLoader;
|
||||
|
|
Loading…
Add table
Reference in a new issue