Skip to content

Commit

Permalink
Merge pull request #9597 from kabir/upcore3a23
Browse files Browse the repository at this point in the history
[WFLY-8016] Merging latest changes from Invocation and WildFly Elytron integration topic branch.
  • Loading branch information
kabir committed Feb 5, 2017
2 parents da543f7 + 3e7ade6 commit fcee6d7
Show file tree
Hide file tree
Showing 260 changed files with 3,538 additions and 9,495 deletions.
Expand Up @@ -48,8 +48,6 @@
import org.jboss.as.server.deployment.SetupAction;
import org.jboss.as.server.deployment.reflect.ClassReflectionIndex;
import org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex;
import org.jboss.ejb.client.EJBClientConfiguration;
import org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration;
import org.jboss.metadata.appclient.spec.ApplicationClientMetaData;
import org.jboss.modules.Module;
import org.wildfly.security.manager.WildFlySecurityManager;
Expand Down Expand Up @@ -122,7 +120,6 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU
final List<SetupAction> setupActions = deploymentUnit.getAttachmentList(org.jboss.as.ee.component.Attachments.OTHER_EE_SETUP_ACTIONS);

if (connectionPropertiesUrl != null) {
EJBClientConfiguration configuration;
try {
final File file = new File(connectionPropertiesUrl);
final URL url;
Expand All @@ -148,21 +145,8 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU
final ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
try {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
configuration = new PropertiesBasedEJBClientConfiguration(properties);

//if there is no username or callback handler specified in the ejb-client properties file
//we override the default
if (!properties.contains("username") && !properties.contains("callback.handler.class")) {
//no security config so we wrap the configuration
configuration = new ForwardingEjbClientConfiguration(configuration) {
@Override
public CallbackHandler getCallbackHandler() {
return callbackHandler;
}
};
}

startService = new ApplicationClientStartService(mainMethod, parameters, moduleDescription.getNamespaceContextSelector(), module.getClassLoader(), setupActions, configuration);
startService = new ApplicationClientStartService(mainMethod, parameters, moduleDescription.getNamespaceContextSelector(), module.getClassLoader(), setupActions);
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl);
}
Expand Down

This file was deleted.

Expand Up @@ -21,9 +21,9 @@
*/
package org.jboss.as.appclient.service;

import static org.jboss.as.appclient.logging.AppClientLogger.ROOT_LOGGER;

import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
Expand All @@ -35,10 +35,6 @@
import org.jboss.as.ee.naming.InjectedEENamespaceContextSelector;
import org.jboss.as.naming.context.NamespaceContextSelector;
import org.jboss.as.server.deployment.SetupAction;
import org.jboss.ejb.client.ContextSelector;
import org.jboss.ejb.client.EJBClientConfiguration;
import org.jboss.ejb.client.EJBClientContext;
import org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceContainer;
import org.jboss.msc.service.ServiceName;
Expand All @@ -48,8 +44,6 @@
import org.jboss.msc.value.InjectedValue;
import org.wildfly.security.manager.WildFlySecurityManager;

import static org.jboss.as.appclient.logging.AppClientLogger.ROOT_LOGGER;


/**
* Service that is responsible for running an application clients main method, and shutting down the server once it
Expand All @@ -69,7 +63,6 @@ public class ApplicationClientStartService implements Service<ApplicationClientS
private final Method mainMethod;
private final String[] parameters;
private final ClassLoader classLoader;
private final ContextSelector<EJBClientContext> contextSelector;

private Thread thread;
private ComponentInstance instance;
Expand All @@ -80,16 +73,14 @@ public ApplicationClientStartService(final Method mainMethod, final String[] par
this.namespaceContextSelectorInjectedValue = namespaceContextSelectorInjectedValue;
this.classLoader = classLoader;
this.setupActions = setupActions;
this.contextSelector = new LazyConnectionContextSelector(hostUrl, callbackHandler, classLoader);
}

public ApplicationClientStartService(final Method mainMethod, final String[] parameters, final InjectedEENamespaceContextSelector namespaceContextSelectorInjectedValue, final ClassLoader classLoader, final List<SetupAction> setupActions, final EJBClientConfiguration configuration) {
public ApplicationClientStartService(final Method mainMethod, final String[] parameters, final InjectedEENamespaceContextSelector namespaceContextSelectorInjectedValue, final ClassLoader classLoader, final List<SetupAction> setupActions) {
this.mainMethod = mainMethod;
this.parameters = parameters;
this.namespaceContextSelectorInjectedValue = namespaceContextSelectorInjectedValue;
this.classLoader = classLoader;
this.setupActions = setupActions;
this.contextSelector = new ConfigBasedEJBClientContextSelector(configuration);
}
@Override
public synchronized void start(final StartContext context) throws StartException {
Expand All @@ -101,10 +92,8 @@ public synchronized void start(final StartContext context) throws StartException
public void run() {
final ClassLoader oldTccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
try {
try {
try {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader);
AccessController.doPrivileged(new SetSelectorAction(contextSelector));
applicationClientDeploymentServiceInjectedValue.getValue().getDeploymentCompleteLatch().await();
NamespaceContextSelector.setDefault(namespaceContextSelectorInjectedValue);

Expand Down Expand Up @@ -138,11 +127,7 @@ public void run() {
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl);
}
} finally {
if(contextSelector instanceof LazyConnectionContextSelector) {
((LazyConnectionContextSelector)contextSelector).close();
}
}

} finally {
serviceContainer.shutdown();
}
Expand Down Expand Up @@ -182,18 +167,4 @@ public InjectedValue<Component> getApplicationClientComponent() {
return applicationClientComponent;
}


private static final class SetSelectorAction implements PrivilegedAction<ContextSelector<EJBClientContext>> {

private final ContextSelector<EJBClientContext> selector;

private SetSelectorAction(final ContextSelector<EJBClientContext> selector) {
this.selector = selector;
}

@Override
public ContextSelector<EJBClientContext> run() {
return EJBClientContext.setSelector(selector);
}
}
}

This file was deleted.

Empty file added derby.log
Empty file.

0 comments on commit fcee6d7

Please sign in to comment.