-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit also removes a few outdated references to Web Beans.
- Loading branch information
Showing
13 changed files
with
160 additions
and
9 deletions.
There are no files selected for viewing
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
70 changes: 70 additions & 0 deletions
70
api/src/main/java/org/jboss/cdi/tck/spi/CreationalContexts.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,70 @@ | ||
/* | ||
* Copyright 2023, Red Hat, Inc., 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.cdi.tck.spi; | ||
|
||
import jakarta.enterprise.context.spi.Contextual; | ||
import jakarta.enterprise.context.spi.CreationalContext; | ||
|
||
/** | ||
* Provides CreationalContext related operations. | ||
* | ||
* The TCK porting package must provide an implementation of this interface which is suitable for the target implementation. | ||
*/ | ||
public interface CreationalContexts { | ||
|
||
public static final String PROPERTY_NAME = CreationalContexts.class.getName(); | ||
|
||
/** | ||
* Creates an {@linkplain Inspectable inspectable} CreationalContext for given Contextual. | ||
* This operation is identical to {@link jakarta.enterprise.inject.spi.BeanContainer#createCreationalContext(Contextual)}, | ||
* except it returns a specialized variant of CreationalContext that can be inspected. | ||
* | ||
* @param contextual a Contextual for which a CreationalContext should be created | ||
* @return a CreationalContext that can be inspected | ||
* @param <T> type of the instance | ||
*/ | ||
public <T> Inspectable<T> create(Contextual<T> contextual); | ||
|
||
/** | ||
* A CreationalContext that can be inspected. | ||
* | ||
* @param <T> type of the instances | ||
*/ | ||
public static interface Inspectable<T> extends CreationalContext<T> { | ||
/** | ||
* Returns whether {@link #push(Object)} was called on this CreationalContext. | ||
* | ||
* @return whether {@link #push(Object)} was called on this CreationalContext. | ||
*/ | ||
public boolean isPushCalled(); | ||
|
||
/** | ||
* If {@code push} {@linkplain #isPushCalled() was called} on this CreationalContext, returns the pushed object. | ||
* Returns {@code null} otherwise. | ||
* | ||
* @return the pushed object if {@code push} was called, otherwise {@code null} | ||
*/ | ||
public Object getLastBeanPushed(); | ||
|
||
/** | ||
* Returns whether {@link #release()} was called on this CreationalContext. | ||
* | ||
* @return whether {@link #release()} was called on this CreationalContext. | ||
*/ | ||
public boolean isReleaseCalled(); | ||
} | ||
|
||
} |
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
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
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
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
26 changes: 26 additions & 0 deletions
26
impl/src/test/java/org/jboss/cdi/tck/test/porting/DummyCreationalContexts.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,26 @@ | ||
/* | ||
* Copyright 2023, Red Hat, Inc., 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.cdi.tck.test.porting; | ||
|
||
import jakarta.enterprise.context.spi.Contextual; | ||
import org.jboss.cdi.tck.spi.CreationalContexts; | ||
|
||
public class DummyCreationalContexts implements CreationalContexts { | ||
@Override | ||
public <T> Inspectable<T> create(Contextual<T> contextual) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
web/src/test/java/org/jboss/cdi/tck/test/porting/DummyCreationalContexts.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,26 @@ | ||
/* | ||
* Copyright 2023, Red Hat, Inc., 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.cdi.tck.test.porting; | ||
|
||
import jakarta.enterprise.context.spi.Contextual; | ||
import org.jboss.cdi.tck.spi.CreationalContexts; | ||
|
||
public class DummyCreationalContexts implements CreationalContexts { | ||
@Override | ||
public <T> Inspectable<T> create(Contextual<T> contextual) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |