Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PAXCDI-186] fixed regression for alternatives
- Loading branch information
Showing
7 changed files
with
94 additions
and
4 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
pax-cdi-samples/pax-cdi-sample6/src/main/java/org/ops4j/pax/cdi/sample6/MessageSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.ops4j.pax.cdi.sample6; | ||
|
||
|
||
public interface MessageSource extends MessageProducer { | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...di-sample6/src/main/java/org/ops4j/pax/cdi/sample6/impl/AlternativeMessageSourceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2015 Harald Wellmann. | ||
* | ||
* 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.ops4j.pax.cdi.sample6.impl; | ||
|
||
import javax.enterprise.inject.Alternative; | ||
|
||
import org.ops4j.pax.cdi.sample6.MessageSource; | ||
|
||
@Alternative | ||
public class AlternativeMessageSourceImpl implements MessageSource { | ||
|
||
@Override | ||
public String getMessage() { | ||
return "Quod erat demonstrandum."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...mples/pax-cdi-sample6/src/main/java/org/ops4j/pax/cdi/sample6/impl/MessageSourceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2015 Harald Wellmann. | ||
* | ||
* 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.ops4j.pax.cdi.sample6.impl; | ||
|
||
import org.ops4j.pax.cdi.sample6.MessageSource; | ||
|
||
|
||
public class MessageSourceImpl implements MessageSource { | ||
|
||
@Override | ||
public String getMessage() { | ||
return "Tertium non datur."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<beans xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd"> | ||
<alternatives> | ||
<class>org.ops4j.pax.cdi.sample6.impl.AlternativeMessageSourceImpl</class> | ||
</alternatives> | ||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters