Skip to content
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
12 changes: 11 additions & 1 deletion appserver/admingui/commandrecorder/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2024 Contributors to the Eclipse Foundation
Copyright (c) 2024,2025 Contributors to the Eclipse Foundation

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -63,4 +63,14 @@
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>dev</id>
<properties>
<copy.modules.to.distribution.skip>false</copy.modules.to.distribution.skip>
<copy.modules.to.distribution.destFile>${basedir}/../../distributions/glassfish/target/stage/glassfish7/glassfish/lib/install/applications/__admingui/WEB-INF/lib/${project.artifactId}-${project.version}.jar</copy.modules.to.distribution.destFile>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.glassfish.commandrecorder.admingui.plugin;


import java.net.URL;

import org.glassfish.api.admingui.ConsoleProvider;
Expand Down
11 changes: 11 additions & 0 deletions appserver/admingui/common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2025 Contributors to the Eclipse Foundation
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -129,4 +130,14 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>dev</id>
<properties>
<copy.modules.to.distribution.skip>false</copy.modules.to.distribution.skip>
</properties>
</profile>
</profiles>

</project>
6 changes: 6 additions & 0 deletions appserver/admingui/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.main.core</groupId>
<artifactId>kernel</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -15,27 +15,55 @@
*/
package org.glassfish.admingui.cdi;

import com.sun.enterprise.v3.admin.AdminCommandJob;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.faces.context.FacesContext;
import jakarta.servlet.ServletContext;

import org.glassfish.api.ActionReport;
import org.glassfish.api.admin.CommandRunner;
import org.glassfish.api.admin.Job;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.internal.api.Globals;

import static org.glassfish.admingui.common.plugin.ConsoleClassLoader.HABITAT_ATTRIBUTE;

@ApplicationScoped
public class Hk2ServicesProducer {

@Produces
ServiceLocator produceLocator() {
ServletContext servletCtx = (ServletContext)
(FacesContext.getCurrentInstance().getExternalContext()).getContext();

ServiceLocator locator = (ServiceLocator) servletCtx.getAttribute(HABITAT_ATTRIBUTE);

if (locator == null) {
return Globals.getDefaultHabitat();
}
return locator;
}

@Produces
CommandRunner getCommandRunner() {
return getGlobalService(CommandRunner.class);
return produceLocator().getService(CommandRunner.class);
}

@Produces
ActionReport getActionReport() {
return getGlobalService(ActionReport.class);
public CommandRunner<AdminCommandJob> produceAdminCommandJobCommandRunner() {
return getCommandRunner();
}

private static <T> T getGlobalService(Class<T> aClass) {
return Globals.getDefaultHabitat().getService(aClass);
@Produces
public CommandRunner<Job> produceJobCommandRunner() {
return getCommandRunner();
}

@Produces
ActionReport getActionReport() {
return produceLocator().getService(ActionReport.class);
}

}