229N/A/*
229N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
229N/A *
229N/A * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
229N/A *
229N/A * The contents of this file are subject to the terms of either the GNU
229N/A * General Public License Version 2 only ("GPL") or the Common Development
229N/A * and Distribution License("CDDL") (collectively, the "License"). You
229N/A * may not use this file except in compliance with the License. You can
229N/A * obtain a copy of the License at
229N/A * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
229N/A * or packager/legal/LICENSE.txt. See the License for the specific
229N/A * language governing permissions and limitations under the License.
229N/A *
229N/A * When distributing the software, include this License Header Notice in each
229N/A * file and include the License file at packager/legal/LICENSE.txt.
229N/A *
229N/A * GPL Classpath Exception:
229N/A * Oracle designates this particular file as subject to the "Classpath"
229N/A * exception as provided by Oracle in the GPL Version 2 section of the License
229N/A * file that accompanied this code.
229N/A *
229N/A * Modifications:
229N/A * If applicable, add the following below the License Header, with the fields
229N/A * enclosed by brackets [] replaced by your own identifying information:
229N/A * "Portions Copyright [year] [name of copyright owner]"
229N/A *
229N/A * Contributor(s):
229N/A * If you wish your version of this file to be governed by only the CDDL or
229N/A * only the GPL Version 2, indicate your decision by adding "[Contributor]
229N/A * elects to include this software in this distribution under the [CDDL or GPL
229N/A * Version 2] license." If you don't indicate a single choice of license, a
229N/A * recipient has the option to distribute your version of this file under
229N/A * either the CDDL, the GPL Version 2 or to extend the choice of license to
229N/A * its licensees as provided above. However, if you add GPL Version 2 code
229N/A * and therefore, elected the GPL Version 2 license, then the option applies
229N/A * only if the new code is made subject to such option by the copyright
229N/A * holder.
229N/A */
229N/A
229N/Apackage myapp;
229N/A
229N/A
229N/Aimport javax.annotation.PostConstruct;
229N/Aimport javax.ejb.EJB;
229N/Aimport javax.ejb.DependsOn;
229N/Aimport javax.ejb.Singleton;
229N/A
229N/A@Singleton
229N/Apublic class BeanLeaf {
229N/A
229N/A @EJB
229N/A private BeanMessageInterface msg;
229N/A
229N/A String MESSAGE_POST = "PostBeanLeaf";
229N/A String MESSAGE_HELLO = "HelloBeanLeaf";
229N/A
229N/A @PostConstruct
229N/A public void afterConstruct() {
229N/A if (msg != null && !msg.getMessage().contains(MESSAGE_POST)){
229N/A msg.appendMessage(MESSAGE_POST);
229N/A }
229N/A }
229N/A
229N/A public String sayHello() {
229N/A if (msg != null && !msg.getMessage().contains(MESSAGE_HELLO)){
229N/A msg.appendMessage(MESSAGE_HELLO);
229N/A }
229N/A return "Hello from: " + this.getClass().getName() + "; " + System.identityHashCode(this);
229N/A }
229N/A
229N/A}
229N/A