Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Raphael
histream
Commits
94f68503
Commit
94f68503
authored
Nov 16, 2016
by
R.W.Majeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
retrieve registered extensions by instance type
parent
3fb959bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
histream-core/src/main/java/de/sekmi/histream/ObservationFactory.java
...e/src/main/java/de/sekmi/histream/ObservationFactory.java
+2
-0
histream-core/src/main/java/de/sekmi/histream/impl/ObservationFactoryImpl.java
...n/java/de/sekmi/histream/impl/ObservationFactoryImpl.java
+9
-0
No files found.
histream-core/src/main/java/de/sekmi/histream/ObservationFactory.java
View file @
94f68503
...
...
@@ -38,6 +38,8 @@ public interface ObservationFactory {
*/
void
registerExtension
(
Extension
<?>
extension
);
<
T
>
Extension
<
T
>
getExtension
(
Class
<
T
>
type
);
/**
* Get a list of currently registered extensions
* @return currently registered extensions
...
...
histream-core/src/main/java/de/sekmi/histream/impl/ObservationFactoryImpl.java
View file @
94f68503
...
...
@@ -190,5 +190,14 @@ public class ObservationFactoryImpl implements ObservationFactory{
}
};
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
<
T
>
Extension
<
T
>
getExtension
(
Class
<
T
>
extensionType
)
{
ExtensionEntry
e
=
extensions
.
get
(
extensionType
);
if
(
e
==
null
){
return
null
;
}
return
(
Extension
<
T
>)
e
.
extension
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment