-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
25 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 7 additions & 61 deletions
68
...src/main/java/org/mule/runtime/module/service/api/artifact/ServiceClassLoaderFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,23 @@ | ||
/* | ||
* Copyright 2023 Salesforce, Inc. All rights reserved. | ||
* The software in this package is published under the terms of the CPAL v1.0 | ||
* license, a copy of which has been included with this distribution in the | ||
* LICENSE.txt file. | ||
*/ | ||
package org.mule.runtime.module.service.api.artifact; | ||
|
||
import org.mule.runtime.container.api.ContainerDependantArtifactClassLoaderFactory; | ||
import org.mule.runtime.container.api.MuleContainerClassLoaderWrapper; | ||
import org.mule.runtime.container.internal.DefaultMuleContainerClassLoaderWrapper; | ||
import org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader; | ||
import org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoaderFactory; | ||
import org.mule.runtime.module.artifact.api.classloader.ClassLoaderLookupPolicy; | ||
import org.mule.runtime.module.artifact.api.classloader.MuleArtifactClassLoader; | ||
|
||
/** | ||
* Creates {@link ArtifactClassLoader} for service descriptors. | ||
* | ||
*/ | ||
// TODO W-12780081 - remove usages of deprecated creation method | ||
public class ServiceClassLoaderFactory | ||
implements ArtifactClassLoaderFactory<ServiceDescriptor>, ContainerDependantArtifactClassLoaderFactory<ServiceDescriptor> { | ||
public interface ServiceClassLoaderFactory | ||
extends ArtifactClassLoaderFactory<ServiceDescriptor>, ContainerDependantArtifactClassLoaderFactory<ServiceDescriptor> { | ||
|
||
/** | ||
* @deprecated from 4.6 use {@link ServiceClassLoaderFactoryProvider} instead. | ||
*/ | ||
@Deprecated | ||
public ServiceClassLoaderFactory() { | ||
// Nothing to do | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* | ||
* @deprecated since 4.6, use {@link #create(String, ServiceDescriptor, MuleContainerClassLoaderWrapper)}. | ||
*/ | ||
@Override | ||
@Deprecated | ||
public ArtifactClassLoader create(String artifactId, ServiceDescriptor descriptor, ClassLoader parent, | ||
ClassLoaderLookupPolicy lookupPolicy) { | ||
return new MuleArtifactClassLoader(artifactId, descriptor, descriptor.getClassLoaderConfiguration().getUrls(), parent, | ||
lookupPolicy); | ||
} | ||
ArtifactClassLoader create(String artifactId, ServiceDescriptor descriptor, ClassLoader parent, | ||
ClassLoaderLookupPolicy lookupPolicy); | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ArtifactClassLoader create(String artifactId, ServiceDescriptor descriptor, | ||
MuleContainerClassLoaderWrapper containerClassLoader) { | ||
return new MuleArtifactClassLoader(artifactId, descriptor, descriptor.getClassLoaderConfiguration().getUrls(), | ||
containerClassLoader.getContainerClassLoader().getClassLoader(), | ||
containerClassLoader.getContainerClassLoaderLookupPolicy()); | ||
} | ||
|
||
/** | ||
* Creates a {@link ClassLoader} from a given descriptor. | ||
* | ||
* @param artifactId artifact unique ID. | ||
* @param descriptor descriptor of the artifact owner of the created class loader. | ||
* @param containerClassLoader parent for the new artifact class loader. | ||
* @return a new class loader for described artifact. | ||
* | ||
* @since 4.6 | ||
*/ | ||
public ArtifactClassLoader create(String artifactId, ServiceDescriptor descriptor, | ||
ArtifactClassLoader containerClassLoader) { | ||
return create(artifactId, descriptor, new DefaultMuleContainerClassLoaderWrapper(containerClassLoader)); | ||
} | ||
ArtifactClassLoader create(String artifactId, ServiceDescriptor descriptor, | ||
MuleContainerClassLoaderWrapper containerClassLoader); | ||
|
||
@Override | ||
public void setParentLayerFrom(Class clazz) { | ||
// Nothing to do | ||
} | ||
|
||
void setParentLayerFrom(Class clazz); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters