Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
21f6a55b
Commit
21f6a55b
authored
10 years ago
by
Ryan Izard
Browse files
Options
Downloads
Patches
Plain Diff
Commented my edits to the NotificationManagerFactory's init() function.
parent
f7d14cd5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/notification/NotificationManagerFactory.java
+20
-3
20 additions, 3 deletions
...htcontroller/notification/NotificationManagerFactory.java
with
20 additions
and
3 deletions
src/main/java/net/floodlightcontroller/notification/NotificationManagerFactory.java
+
20
−
3
View file @
21f6a55b
...
...
@@ -7,6 +7,7 @@ import net.floodlightcontroller.notification.syslog.SyslogNotificationFactory;
* instance.
*
* @author kevinwang
* @edited Ryan Izard, rizard@g.clemson.edu, ryan.izard@bigswich.com
*
*/
public
class
NotificationManagerFactory
{
...
...
@@ -14,7 +15,17 @@ public class NotificationManagerFactory {
public
static
final
String
NOTIFICATION_FACTORY_NAME
=
"floodlight.notification.factoryName"
;
// default to SyslogNotificationFactory
/**
* Do not set the default here. Delay until init(), which will be
* called by the JVM at class load. This will allow the unit tests
* to test dynamic binding to a factory, then reset to the default
* factory by clearing the System property and then calling init()
* again for subsequent unit tests that actually need a non-mocked
* NotificationManagerFactory.
*
* If a dynamic binding is not specified, init() will fall through
* to else and the default of SyslogNotifcationFactory will be used.
*/
private
static
INotificationManagerFactory
factory
;
/**
...
...
@@ -28,7 +39,13 @@ public class NotificationManagerFactory {
}
/**
* A simple mechanism to initialize factory with dynamic binding
* A simple mechanism to initialize factory with dynamic binding.
*
* Extended to default to SyslogNotifcationFactory in the event
* a dynamic binding is not specified via System properties.
* This allows init() to be called multiple times for the unit tests
* and select the default or a another factory if the System property
* is cleared or is set, respectively.
*/
protected
static
void
init
()
{
String
notificationfactoryClassName
=
null
;
...
...
@@ -47,7 +64,7 @@ public class NotificationManagerFactory {
throw
new
RuntimeException
(
e
);
}
}
else
{
factory
=
new
SyslogNotificationFactory
();
factory
=
new
SyslogNotificationFactory
();
// use as the default
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment