<commit_before>/*
 * JBoss, Home of Professional Open Source
 * Copyright 2010, Red Hat Inc., and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.jboss.as.weld.deployment;

import org.jboss.as.ejb3.component.EJBComponentDescription;
import org.jboss.as.ejb3.component.singleton.SingletonComponentDescription;
import org.jboss.as.ejb3.component.stateful.StatefulComponentDescription;
import org.jboss.as.ejb3.component.stateless.StatelessComponentDescription;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.msc.service.ServiceName;
import org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.weld.ejb.spi.EjbDescriptor;
import org.jboss.weld.resources.spi.ResourceLoader;

import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Implementation of EjbDescriptor
 * @author <NAME>
 */
public class EjbDescriptorImpl<T> implements EjbDescriptor<T>{

    private final EJBComponentDescription componentDescription;
    private final BeanDeploymentArchiveImpl beanDeploymentArchive;
    private final Set<BusinessInterfaceDescriptor<?>> localInterfaces;
    private final ServiceName baseName;

    public EjbDescriptorImpl(EJBComponentDescription componentDescription, BeanDeploymentArchiveImpl beanDeploymentArchive,DeploymentUnit deploymentUnit) {
        this.componentDescription = componentDescription;
        this.beanDeploymentArchive = beanDeploymentArchive;
        final Set<BusinessInterfaceDescriptor<?>> localInterfaces = new HashSet<BusinessInterfaceDescriptor<?>>();
        for(String className : componentDescription.getViewClassNames()) {
            localInterfaces.add(new BusinessInterfaceDescriptorImpl<Object>(beanDeploymentArchive,className));
        }
        this.localInterfaces=localInterfaces;
        this.baseName =  deploymentUnit.getServiceName().append("component").append(componentDescription.getComponentName());
    }


    @Override
    public Class<T> getBeanClass() {
        return (Class<T>) beanDeploymentArchive.getServices().get(ResourceLoader.class).classForName(componentDescription.getEJBClassName());<commit_msg>Migrate EjbDescriptorImpl to new EE framework<commit_after>/*
 * JBoss, Home of Professional Open Source
 * Copyright 2010, Red Hat Inc., and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.jboss.as.weld.deployment;

import org.jboss.as.ee.component.ViewDescription;
import org.jboss.as.ejb3.component.EJBComponentDescription;
import org.jboss.as.ejb3.component.singleton.SingletonComponentDescription;
import org.jboss.as.ejb3.component.stateful.StatefulComponentDescription;
import org.jboss.as.ejb3.component.stateless.StatelessComponentDescription;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.msc.service.ServiceName;
import org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.weld.ejb.spi.EjbDescriptor;
import org.jboss.weld.resources.spi.ResourceLoader;

import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Implementation of EjbDescriptor
 *
 * @author <NAME>
 */
public class EjbDescriptorImpl<T> implements EjbDescriptor<T> {

    private final EJBComponentDescription componentDescription;
    private final BeanDeploymentArchiveImpl beanDeploymentArchive;
    private final Set<BusinessInterfaceDescriptor<?>> localInterfaces;
    private final ServiceName baseName;

    public EjbDescriptorImpl(EJBComponentDescription componentDescription, BeanDeploymentArchiveImpl beanDeploymentArchive, DeploymentUnit deploymentUnit) {
        this.componentDescription = componentDescription;
        this.beanDeploymentArchive = beanDeploymentArchive;
        final Set<BusinessInterfaceDescriptor<?>> localInterfaces = new HashSet<BusinessInterfaceDescriptor<?>>();
        if (componentDescription.getViews() != null) {
            for (ViewDescription view : componentDescription.getViews()) {
                String viewClassName = view.getViewClassName();
                localInterfaces.add(new BusinessInterfaceDescriptorImpl<Object>(beanDeploymentArchive, viewClassName));
            }
        }
        this.localInterfaces = localInterfaces;
        this.baseName = deploymentUnit.getServiceName().append("component").append(componentDescription.getComponentName());
    }


    @Override
    public Class<T> getBeanClass() {
        return (Class<T>) beanDeploymentArchive.getServices().get(ResourceLoader.class).classForName(componentDescription.getEJBClassName());
{'fraction_non_alphanumeric': 0.0816677076826983, 'fraction_numerical': 0.00655840099937539, 'mean_word_length': 4.843978102189781, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1464920', 'n_tokens_mistral': 1741, 'n_tokens_neox': 1630, 'n_words': 498}