Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payara 1487 #1550

Merged
merged 3 commits into from
Apr 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2016 Payara Foundation and/or its affiliates. All rights reserved.
* Copyright (c) 2016-2017 Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -39,11 +39,6 @@
*/
package fish.payara.micro;

//import fish.payara.appserver.micro.services.CDIEventListener;
//import fish.payara.appserver.micro.services.PayaraClusterListener;
//import fish.payara.appserver.micro.services.PayaraClusteredCDIEvent;
//import fish.payara.appserver.micro.services.command.ClusterCommandResult;
//import fish.payara.appserver.micro.services.data.InstanceDescriptor;
import fish.payara.micro.event.PayaraClusteredCDIEvent;
import fish.payara.micro.event.PayaraClusterListener;
import fish.payara.micro.event.CDIEventListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
package fish.payara.micro.cdi.extension;

import fish.payara.micro.PayaraInstance;
import fish.payara.micro.PayaraMicro;
import fish.payara.micro.PayaraMicroRuntime;
import javax.enterprise.inject.Produces;
import org.glassfish.internal.api.Globals;

Expand All @@ -49,14 +51,19 @@
*/
public class PayaraMicroProducer {

private final PayaraInstance runtime;
private final PayaraInstance instance;

PayaraMicroProducer() {
runtime = Globals.getDefaultHabitat().getService(PayaraInstance.class);
instance = Globals.getDefaultHabitat().getService(PayaraInstance.class);
}

@Produces
PayaraInstance getRuntime() {
return runtime;
public PayaraInstance getInstance() {
return instance;
}

@Produces
public PayaraMicroRuntime getRuntime() {
return PayaraMicro.getInstance().getRuntime();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ and Distribution License("CDDL") (collectively, the "License"). You
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
Expand Down Expand Up @@ -122,6 +123,8 @@ public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
me.setInstanceName(instanceName);
}



@Override
public <T extends Serializable> Map<String, Future<T>> runCallable(Collection<String> memberUUIDS, Callable<T> callable) {
Expand All @@ -130,7 +133,7 @@ public <T extends Serializable> Map<String, Future<T>> runCallable(Collection<St

@Override
public <T extends Serializable> Map<String, Future<T>> runCallable(Callable<T> callable) {
return cluster.getExecService().runCallable(callable);
return cluster.getExecService().runCallableAllMembers(callable);
}

@Override
Expand All @@ -141,7 +144,7 @@ public ClusterCommandResult executeLocalAsAdmin(String command, String... parame
@Override
public Map<String, Future<ClusterCommandResult>> executeClusteredASAdmin(String command, String... parameters) {
AsAdminCallable callable = new AsAdminCallable(command, parameters);
Map<String, Future<ClusterCommandResult>> result = cluster.getExecService().runCallable(callable);
Map<String, Future<ClusterCommandResult>> result = cluster.getExecService().runCallableAllMembers(callable);
return result;
}

Expand Down Expand Up @@ -187,7 +190,7 @@ void postConstruct() {
events.register(this);
myListeners = new HashSet<>(1);
myCDIListeners = new HashSet<>(1);
initialiseInstanceDescriptor();
initialiseInstanceDescriptor();
}

/**
Expand Down
Loading