Skip to content

Commit 9bbd3f7

Browse files
committed
OWB-1448 rework following feedback
1 parent eb4b4c6 commit 9bbd3f7

3 files changed

Lines changed: 15 additions & 35 deletions

File tree

webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,13 @@
108108
import javax.enterprise.inject.spi.ObserverMethod;
109109
import javax.enterprise.inject.spi.Producer;
110110

111-
import java.io.IOException;
112111
import java.lang.annotation.Annotation;
113112
import java.lang.reflect.Constructor;
114113
import java.lang.reflect.Method;
115114
import java.lang.reflect.Modifier;
116115
import java.lang.reflect.ParameterizedType;
117116
import java.lang.reflect.Type;
118117
import java.net.URL;
119-
import java.net.URLConnection;
120-
import java.net.URLStreamHandler;
121118
import java.security.PrivilegedActionException;
122119
import java.util.ArrayList;
123120
import java.util.Collection;
@@ -1710,34 +1707,6 @@ protected void deployFromXML(ScannerService scanner)
17101707
}
17111708

17121709
logger.fine("Deploying configurations from XML has ended successfully.");
1713-
1714-
try
1715-
{
1716-
final URL url = new URL("openwebbeans", null, 0, "cdi-standalone", new URLStreamHandler()
1717-
{
1718-
@Override
1719-
protected URLConnection openConnection(URL u) throws IOException
1720-
{
1721-
return null;
1722-
}
1723-
});
1724-
1725-
final BeanArchiveInformation beanArchiveInformation = beanArchiveService.getBeanArchiveInformation(url);
1726-
if (beanArchiveInformation != null)
1727-
{
1728-
configureDecorators(url, beanArchiveInformation.getDecorators());
1729-
configureInterceptors(url, beanArchiveInformation.getInterceptors());
1730-
configureAlternatives(url, beanArchiveInformation.getAlternativeClasses(), false);
1731-
configureAlternatives(url, beanArchiveInformation.getAlternativeStereotypes(), true);
1732-
configureAllowProxying(url, beanArchiveInformation.getAllowProxyingClasses());
1733-
}
1734-
1735-
logger.fine("Deploying embedded configurations has ended successfully.");
1736-
}
1737-
catch (Exception e)
1738-
{
1739-
logger.info("Error occurred: " + e.getMessage());
1740-
}
17411710
}
17421711

17431712
private void configureAlternatives(URL bdaLocation, List<String> alternatives, boolean isStereotype)

webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public abstract class AbstractMetaDataDiscovery implements BdaScannerService
9090
* We store this information since not all containers and storages do support
9191
* new URL(...).
9292
*/
93-
private final Map<String, URL> beanDeploymentUrls = new HashMap<>();
93+
protected final Map<String, URL> beanDeploymentUrls = new HashMap<>();
9494

9595
/**
9696
* for having proper scan mode 'SCOPED' support we need to know which bean class

webbeans-se/src/main/java/org/apache/openwebbeans/se/CDISeScannerService.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
import java.net.URL;
3535
import java.net.URLConnection;
3636
import java.net.URLStreamHandler;
37-
import java.util.ArrayList;
38-
import java.util.Collection;
39-
import java.util.Enumeration;
37+
import java.util.*;
4038
import java.util.stream.Stream;
4139
import java.util.stream.StreamSupport;
4240

@@ -217,4 +215,17 @@ public boolean accept(String name)
217215
return accepts;
218216
}
219217
}
218+
219+
@Override
220+
public Set<URL> getBeanXmls()
221+
{
222+
final Set<URL> result = new HashSet<>(super.getBeanXmls());
223+
final URL embeddedUrl = beanDeploymentUrls.get(CDISeBeanArchiveService.EMBEDDED_URL);
224+
if (embeddedUrl != null)
225+
{
226+
result.add(embeddedUrl);
227+
}
228+
229+
return result;
230+
}
220231
}

0 commit comments

Comments
 (0)