From 2535e35bd9464bb1c505a3699c78b75753e15383 Mon Sep 17 00:00:00 2001 From: Eduardo Martins Date: Mon, 13 Nov 2023 14:19:36 +0000 Subject: [PATCH] [WFLY-18737] Remove shopping-cart quickstart, which functionality is better covered by ejb-remote --- pom.xml | 1 - shopping-cart/README.adoc | 199 ------------------ shopping-cart/client/pom.xml | 84 -------- .../jboss/as/quickstarts/client/Client.java | 111 ---------- .../resources/META-INF/wildfly-config.xml | 43 ---- shopping-cart/configure-system-exception.cli | 15 -- shopping-cart/pom.xml | 135 ------------ shopping-cart/restore-system-exception.cli | 15 -- shopping-cart/server/pom.xml | 59 ------ .../as/quickstarts/sfsb/ShoppingCart.java | 32 --- .../as/quickstarts/sfsb/ShoppingCartBean.java | 53 ----- 11 files changed, 747 deletions(-) delete mode 100644 shopping-cart/README.adoc delete mode 100644 shopping-cart/client/pom.xml delete mode 100644 shopping-cart/client/src/main/java/org/jboss/as/quickstarts/client/Client.java delete mode 100644 shopping-cart/client/src/main/resources/META-INF/wildfly-config.xml delete mode 100644 shopping-cart/configure-system-exception.cli delete mode 100644 shopping-cart/pom.xml delete mode 100644 shopping-cart/restore-system-exception.cli delete mode 100644 shopping-cart/server/pom.xml delete mode 100644 shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCart.java delete mode 100644 shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCartBean.java diff --git a/pom.xml b/pom.xml index 54eb2e0f6f..d315311f55 100644 --- a/pom.xml +++ b/pom.xml @@ -344,7 +344,6 @@ servlet-async servlet-filterlistener servlet-security - shopping-cart tasks-jsf temperature-converter todo-backend diff --git a/shopping-cart/README.adoc b/shopping-cart/README.adoc deleted file mode 100644 index 18747dd702..0000000000 --- a/shopping-cart/README.adoc +++ /dev/null @@ -1,199 +0,0 @@ -include::../shared-doc/attributes.adoc[] - -= shopping-cart: EJB Stateful Session Bean (SFSB) Example -:author: Serge Pagop -:level: Intermediate -:technologies: SFSB EJB - -[abstract] -The `shopping-cart` quickstart demonstrates how to deploy and run a simple {javaVersion} shopping cart application that uses a stateful session bean (SFSB). - -:standalone-server-type: default -:archiveType: jar -:archiveDir: {artifactId}/server/target -:restoreScriptName: restore-system-exception.cli - -== What is it? - -The `shopping-cart` quickstart demonstrates how to deploy and run a simple {javaVersion} application that uses a stateful session bean (SFSB) in {productNameFull}. The application allows customers to buy, checkout, and view their cart contents. - -The `shopping-cart` application consists of the following: - -. A server side component: -+ -This standalone Jakarta EE module is a JAR containing EJBs. It is responsible for managing the shopping cart. - -. A Java client: -+ -This simple Java client is launched using a `main` method. The remote client looks up a reference to the server module's API, via JNDI. It then uses this API to perform the operations the customer requests. - -// System Requirements -include::../shared-doc/system-requirements.adoc[leveloffset=+1] -// Use of {jbossHomeName} -include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1] -// Back Up the {productName} Standalone Server Configuration -include::../shared-doc/back-up-server-standalone-configuration.adoc[leveloffset=+1] -// Start the {productName} Standalone Server -include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+1] - -[[configure_the_server]] -== Configure the Server - -This example quickstart purposely throws a `NoSuchEJBException` exception when the shopping cart is empty. This is the expected result because method is annotated with `@Remove`. This means the next invocation after the shopping cart checkout fails because the container has destroyed the instance and it is no longer available. If you do not run this script, you see the following ERROR in the server log, followed by the stacktrace - -[source,options="nowrap"] ----- -ERROR [org.jboss.as.ejb3.invocation] (EJB default - 7) WFLYEJB0034: EJB Invocation failed on component ShoppingCartBean for method public abstract java.util.Map org.jboss.as.quickstarts.sfsb.ShoppingCart.getCartContents(): jakarta.ejb.NoSuchEJBException: WFLYEJB0168: Could not find EJB with id UnknownSessionID [5168576665505352655054705267485457555457535250485552546568575254] ----- - -Follow the steps below to suppress system exception logging. - -. Before you begin, make sure you do the following: - -* xref:back_up_standalone_server_configuration[Back up the {productName} standalone server configuration] as described above. -* xref:start_the_eap_standalone_server[Start the {productName} server with the standalone default profile] as described above. - -. Review the `configure-system-exception.cli` file in the root of this quickstart directory. This script sets the `log-system-exceptions` attribute to `false` in the `ejb3` subsystem in the server configuration file. -. Open a new terminal, navigate to the root directory of this quickstart, and run the following command, replacing __{jbossHomeName}__ with the path to your server: -+ -[source,subs="+quotes,attributes+",options="nowrap"] ----- -$ __{jbossHomeName}__/bin/jboss-cli.sh --connect --file=configure-system-exception.cli ----- -+ -NOTE: For Windows, use the `__{jbossHomeName}__\bin\jboss-cli.bat` script. - -+ -You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -The batch executed successfully ----- - -. Stop the {productName} server. - -== Review the Modified Server Configuration - -After stopping the server, open the `__{jbossHomeName}__/standalone/configuration/standalone.xml` file and review the changes. - -You should see the following configuration in the `ejb3` subsystem. - -[source,xml,options="nowrap"] ----- - ----- - - - -// Build and Deploy the Quickstart -include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+1] - -// Additional deployment information - -You can also check the server console to see information messages regarding the deployment. - -[source,options="nowrap"] ----- -INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-2) WFLYEJB0473: JNDI bindings for session bean named 'ShoppingCartBean' in deployment unit 'deployment "{artifactId}-server.jar"' are as follows: - - java:global/{artifactId}-server/ShoppingCartBean!org.jboss.as.quickstarts.sfsb.ShoppingCart - java:app/{artifactId}-server/ShoppingCartBean!org.jboss.as.quickstarts.sfsb.ShoppingCart - java:module/ShoppingCartBean!org.jboss.as.quickstarts.sfsb.ShoppingCart - java:jboss/exported/{artifactId}-server/ShoppingCartBean!org.jboss.as.quickstarts.sfsb.ShoppingCart - java:global/{artifactId}-server/ShoppingCartBean - java:app/{artifactId}-server/ShoppingCartBean - java:module/ShoppingCartBean - -INFO [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0006: Starting Services for CDI deployment: {artifactId}-server.jar -INFO [org.jboss.weld.deployer] (MSC service thread 1-8) WFLYWELD0009: Starting weld service for deployment {artifactId}-server.jar -INFO [org.jboss.as.server] (management-handler-thread - 3) WFLYSRV0010: Deployed "{artifactId}-server.jar" (runtime-name : "{artifactId}-server.jar") ----- - -== Run the Client Application - -Now start a client that will access the beans you just deployed. - -You can use the terminal from the previous step or open a new one and navigate to the root of the `shopping-cart` quickstart directory. - -Type the following command: - -[source,options="nowrap"] ----- -$ mvn exec:java -f client/pom.xml ----- - -== Investigate the Console Output - -You should see the following: - -. The client sends a remote method invocation to the stateful session bean to buy two `32 GB USB 2.0 Flash Drive` and one `Wireless Ergonomic Keyboard and Mouse`. -. The client sends a remote method invocation to get the contents of the cart and prints it to the console. -. The client sends a remote method invocation to invoke checkout. Note the `checkout()` method in the server `ShoppingCartBean` has the `@Remove` annotation. This means the container will destroy shopping cart after the call and it will no longer be available. -. The client calls `getCartContents()` to make sure the shopping cart was removed after checkout. This results in a `jakarta.ejb.NoSuchEJBException` trace in the server, proving the cart was removed. - -. On the client console, you should see output similar to: -+ -[source,options="nowrap"] ----- -&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& -Obtained the remote interface to the shopping cart -Buying a "32 GB USB 2.0 Flash Drive". -Buying another "32 GB USB 2.0 Flash Drive". -Buying a "Wireless Ergonomic Keyboard and Mouse" - -Print cart: -1 Wireless Ergonomic Keyboard and Mouse -2 32 GB USB 2.0 Flash Drive - -Checkout -Cart was correctly removed, as expected, after Checkout -&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ----- - -. In the server log, you should see: -+ -[source,options="nowrap"] ----- -INFO [stdout] (pool-9-thread-8) implementing checkout() left as exercise for the reader! ----- - -// Undeploy the Quickstart -include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1] -// Restore the {productName} Standalone Server Configuration -include::../shared-doc/restore-standalone-server-configuration.adoc[leveloffset=+1] - -// Additional information about this script -This script restores the the `log-system-exceptions` attribute value to `true`. You should see the following result when you run the script: -+ -[source,options="nowrap"] ----- -The batch executed successfully ----- - -// Restore the {productName} Standalone Server Configuration Manually -include::../shared-doc/restore-standalone-server-configuration-manual.adoc[leveloffset=+2] -// Run the Quickstart in Red Hat CodeReady Studio or Eclipse -include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1] - -// Additional Red Hat CodeReady Studio instructions -This quickstart consists of multiple projects, so it deploys and runs differently in {JBDSProductName} than the other quickstarts. - -* Make sure you configure {productName} to suppress system exception logging as described above under xref:configure_the_server[Configure the Server]. Stop the server at the end of that step. -* To deploy the server project, right-click on the *{artifactId}-server* project and choose *Run As* –> *Run on Server*. -* To run the client, right-click on the *{artifactId}-client* project and choose *Run As* –> *Java Application*. In the *Select Java Application* window, choose *Client - org.jboss.as.quickstarts.client* and click *OK*. The client output displays in the *Console* window. -* To undeploy the project, right-click on the *{artifactId}-server* project and choose *Run As* –> *Maven build*. Enter `wildfly:undeploy` for the *Goals* and click *Run*. -* Make sure you xref:restore_the_server_configuration[restore the {productName} standalone server configuration] when you have completed testing this quickstart. - -// Debug the Application -include::../shared-doc/debug-the-application.adoc[leveloffset=+1] - -//************************************************* -// Product Release content only -//************************************************* -ifdef::ProductRelease[] - -// Quickstart not compatible with OpenShift -include::../shared-doc/openshift-incompatibility.adoc[leveloffset=+1] - -endif::[] \ No newline at end of file diff --git a/shopping-cart/client/pom.xml b/shopping-cart/client/pom.xml deleted file mode 100644 index 73c92020de..0000000000 --- a/shopping-cart/client/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - 4.0.0 - - - org.wildfly.quickstarts - shopping-cart - 31.0.0.Beta1-SNAPSHOT - - shopping-cart-client - jar - Quickstart: shopping-cart - client - This project demonstrates a shopping cart that uses a Stateful Session Bean; this is the client POM file - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - - org.wildfly - wildfly-ejb-client-bom - pom - runtime - - - - - ${project.groupId} - shopping-cart-server - ejb - - - - - jakarta.ejb - jakarta.ejb-api - - - - - - ${project.artifactId} - - - - org.codehaus.mojo - exec-maven-plugin - - org.jboss.as.quickstarts.client.Client - false - - - - - - diff --git a/shopping-cart/client/src/main/java/org/jboss/as/quickstarts/client/Client.java b/shopping-cart/client/src/main/java/org/jboss/as/quickstarts/client/Client.java deleted file mode 100644 index 3a5100c3ec..0000000000 --- a/shopping-cart/client/src/main/java/org/jboss/as/quickstarts/client/Client.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2022, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.client; - -import java.util.Map; -import java.util.Hashtable; -import java.util.logging.Level; -import java.util.logging.Logger; - -import jakarta.ejb.NoSuchEJBException; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import org.jboss.as.quickstarts.sfsb.ShoppingCart; -import org.jboss.as.quickstarts.sfsb.ShoppingCartBean; - -public class Client { - - private static final String ACCESSORIES_1 = "Wireless Ergonomic Keyboard and Mouse"; - private static final String ACCESSORIES_2 = "32 GB USB 2.0 Flash Drive"; - - public static void main(String[] args) throws NamingException { - // avoid INFO output for the client demo - Logger.getLogger("org.xnio").setLevel(Level.WARNING); - Logger.getLogger("org.jboss.remoting").setLevel(Level.WARNING); - Logger.getLogger("org.jboss.ejb.client").setLevel(Level.WARNING); - - // Create the JNDI InitialContext, configuring it for use with JBoss EJB - Hashtable jndiProperties = new Hashtable<>(); - jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); - final Context context = new InitialContext(jndiProperties); - - /* - * The app name is the application name of the deployed EJBs. This is typically the ear name without the .ear suffix. - * However, the application name could be overridden in the application.xml of the EJB deployment on the server. Since - * we haven't deployed the application as a .ear, the app name for us will be an empty string - */ - final String appName = ""; - - /* - * This is the module name of the deployed EJBs on the server. This is typically the jar name of the EJB deployment, - * without the .jar suffix, but can be overridden via the ejb-jar.xml. In this example, we have deployed the EJBs in a - * jboss-shopping-cart-server.jar, so the module name is jboss-shopping-cart-server - */ - final String moduleName = "shopping-cart-server"; - - /* - * JBoss EAP allows each deployment to have an (optional) distinct name. We haven't specified a distinct name for our EJB - * deployment, so this is an empty string - */ - final String distinctName = ""; - - /* - * The EJB name which by default is the simple class name of the bean implementation class - */ - final String beanName = ShoppingCartBean.class.getSimpleName(); - - /* The remote view fully qualified class name */ - final String viewClassName = ShoppingCart.class.getName(); - - /* Lookup the remote interface of the shopping cart */ - String lookupName = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName - + "?stateful"; - final ShoppingCart cart = (ShoppingCart) context.lookup(lookupName); - - System.out.println("\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"); - System.out.println("Obtained the remote interface to the shopping cart"); - - /* invoke on the remote interface */ - System.out.println("Buying a \"" + ACCESSORIES_2 + "\""); - cart.buy(ACCESSORIES_2, 1); - System.out.println("Buying another \"" + ACCESSORIES_2 + "\""); - cart.buy(ACCESSORIES_2, 1); - - System.out.println("Buying a \"" + ACCESSORIES_1 + "\""); - cart.buy(ACCESSORIES_1, 1); - - System.out.println("\nPrint cart:"); - Map cartContents = cart.getCartContents(); - for (String product : cartContents.keySet()) { - System.out.println(cartContents.get(product) + " " + product); - } - - System.out.println("\nCheckout"); - cart.checkout(); - - /* Try to access the cart after checkout */ - try { - cart.getCartContents(); - System.err.println("ERROR: The cart should not be available after Checkout!"); - } catch (NoSuchEJBException e) { - System.out.println("Cart was correctly removed, as expected, after Checkout and is no longer available!"); - } - System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n"); - } -} diff --git a/shopping-cart/client/src/main/resources/META-INF/wildfly-config.xml b/shopping-cart/client/src/main/resources/META-INF/wildfly-config.xml deleted file mode 100644 index 76b6cfb1d8..0000000000 --- a/shopping-cart/client/src/main/resources/META-INF/wildfly-config.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/shopping-cart/configure-system-exception.cli b/shopping-cart/configure-system-exception.cli deleted file mode 100644 index 7bc1798045..0000000000 --- a/shopping-cart/configure-system-exception.cli +++ /dev/null @@ -1,15 +0,0 @@ -# Batch script to add the JMS configuration to the JBoss EAP server - -# Start batching commands -batch - -# Suppress system exception stacktraces in the server log -/subsystem=ejb3:write-attribute(name=log-system-exceptions,value=false) - -# Run the batch commands -run-batch - -# Reload the server configuration -reload - - diff --git a/shopping-cart/pom.xml b/shopping-cart/pom.xml deleted file mode 100644 index a5b1220557..0000000000 --- a/shopping-cart/pom.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - 4.0.0 - - org.wildfly.quickstarts - wildfly-quickstart-parent - - 5 - - - - shopping-cart - 31.0.0.Beta1-SNAPSHOT - pom - Quickstart: shopping-cart - This project demonstrates a shopping cart that uses a Stateful Session Bean - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - server - client - - - - - 30.0.0.Final - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - default - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - never - - - true - never - - default - - - - - jboss-public-maven-repository - JBoss Public Maven Repository - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - redhat-ga-maven-repository - Red Hat GA Maven Repository - https://maven.repository.redhat.com/ga/ - - true - - - true - - - - - - - - - org.wildfly.bom - wildfly-ee-with-tools - ${version.server.bom} - pom - import - - - - ${project.groupId} - shopping-cart-server - ${project.version} - ejb - - - - - - diff --git a/shopping-cart/restore-system-exception.cli b/shopping-cart/restore-system-exception.cli deleted file mode 100644 index f2bb6ef124..0000000000 --- a/shopping-cart/restore-system-exception.cli +++ /dev/null @@ -1,15 +0,0 @@ -# Batch script to add the JMS configuration to the JBoss EAP server - -# Start batching commands -batch - -# Restore system exception stacktraces in the server log -/subsystem=ejb3:write-attribute(name=log-system-exceptions,value=true) - -# Run the batch commands -run-batch - -# Reload the server configuration -reload - - diff --git a/shopping-cart/server/pom.xml b/shopping-cart/server/pom.xml deleted file mode 100644 index eb3300de17..0000000000 --- a/shopping-cart/server/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - 4.0.0 - - - org.wildfly.quickstarts - shopping-cart - 31.0.0.Beta1-SNAPSHOT - - shopping-cart-server - ejb - Quickstart: shopping-cart - server - This project demonstrates a shopping cart that uses a Stateful Session Bean; this is the server POM file - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - - - jakarta.annotation - jakarta.annotation-api - provided - - - - - jakarta.ejb - jakarta.ejb-api - provided - - - - - diff --git a/shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCart.java b/shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCart.java deleted file mode 100644 index 1b4490e200..0000000000 --- a/shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCart.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.sfsb; - -import java.util.Map; -import jakarta.ejb.Remote; - -/** - * @author Serge Pagop - */ -@Remote -public interface ShoppingCart { - void buy(String product, int quantity); - - void checkout(); - - Map getCartContents(); -} diff --git a/shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCartBean.java b/shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCartBean.java deleted file mode 100644 index d77cacea85..0000000000 --- a/shopping-cart/server/src/main/java/org/jboss/as/quickstarts/sfsb/ShoppingCartBean.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual - * contributors by the @authors tag. See the copyright.txt in the - * distribution for a full listing of individual contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.as.quickstarts.sfsb; - -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Logger; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; - -/** - * @author Serge Pagop - */ -@Stateful -public class ShoppingCartBean implements ShoppingCart { - - private static final Logger LOGGER = Logger.getLogger(ShoppingCartBean.class.toString()); - - private Map cart = new HashMap<>(); - - public void buy(String product, int quantity) { - if (cart.containsKey(product)) { - int currentQuantity = cart.get(product); - currentQuantity += quantity; - cart.put(product, currentQuantity); - } else { - cart.put(product, quantity); - } - } - - public Map getCartContents() { - return cart; - } - - @Remove - public void checkout() { - LOGGER.info("implementing checkout() left as exercise for the reader!"); - } -}