-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JBWS-3739] Enforce jbossws-spi metadata immutability
- Loading branch information
1 parent
0a278b0
commit e32f27d
Showing
18 changed files
with
250 additions
and
344 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
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
36 changes: 36 additions & 0 deletions
36
webservices/server-integration/src/main/java/org/jboss/as/webservices/dmr/ListInjector.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,36 @@ | ||
package org.jboss.as.webservices.dmr; | ||
|
||
import java.util.List; | ||
|
||
import org.jboss.msc.inject.InjectionException; | ||
import org.jboss.msc.inject.Injector; | ||
import org.jboss.msc.inject.RetainingInjector; | ||
import org.jboss.msc.value.Value; | ||
|
||
public final class ListInjector<T> extends RetainingInjector<T> implements Injector<T> { | ||
private final List<T> list; | ||
|
||
public ListInjector(final List<T> list) { | ||
this.list = list; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public void inject(final T value) throws InjectionException { | ||
synchronized (list) { | ||
list.add(value); | ||
super.inject(value); | ||
} | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
public void uninject() { | ||
synchronized (list) { | ||
try { | ||
final Value<T> storedValue = getStoredValue(); | ||
if (storedValue != null) list.remove(storedValue.getValue()); | ||
} finally { | ||
super.uninject(); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.