Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
joram
joram
Commits
7fff2e13
Commit
7fff2e13
authored
Feb 28, 2011
by
Guillaume Surrel
Browse files
Harmonize exception handling with acquisition module.
parent
8f1ae6cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/DistributionModule.java
View file @
7fff2e13
...
...
@@ -30,7 +30,6 @@ import org.objectweb.joram.mom.notifications.ClientMessages;
import
org.objectweb.joram.mom.util.DMQManager
;
import
org.objectweb.joram.shared.MessageErrorConstants
;
import
org.objectweb.joram.shared.excepts.MessageValueException
;
import
org.objectweb.joram.shared.excepts.RequestException
;
import
org.objectweb.joram.shared.messages.ConversionHelper
;
import
org.objectweb.joram.shared.messages.Message
;
import
org.objectweb.util.monolog.api.BasicLevel
;
...
...
@@ -60,7 +59,7 @@ public class DistributionModule implements Serializable {
/** The distribution queue or topic using this module. */
private
final
Destination
destination
;
public
DistributionModule
(
Destination
destination
,
Properties
properties
)
throws
RequestException
{
public
DistributionModule
(
Destination
destination
,
Properties
properties
)
{
this
.
destination
=
destination
;
setProperties
(
properties
);
}
...
...
@@ -68,7 +67,7 @@ public class DistributionModule implements Serializable {
/**
* Resets the distribution properties.
*/
private
void
setProperties
(
Properties
props
)
throws
RequestException
{
private
void
setProperties
(
Properties
props
)
{
if
(
props
==
null
)
{
return
;
...
...
@@ -97,11 +96,7 @@ public class DistributionModule implements Serializable {
}
catch
(
Exception
exc
)
{
logger
.
log
(
BasicLevel
.
ERROR
,
"DistributionModule: can't create distribution handler."
,
exc
);
throw
new
RequestException
(
exc
.
getMessage
());
}
}
else
if
(
distributionHandler
==
null
)
{
throw
new
RequestException
(
"Distribution class not defined: use "
+
CLASS_NAME
+
" property to chose distribution class."
);
}
}
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/DistributionQueue.java
View file @
7fff2e13
...
...
@@ -77,12 +77,7 @@ public class DistributionQueue extends Queue {
public
void
initialize
(
boolean
firstTime
)
{
super
.
initialize
(
firstTime
);
if
(
distributionModule
==
null
)
{
try
{
distributionModule
=
new
DistributionModule
(
this
,
(
Properties
)
properties
.
clone
());
}
catch
(
RequestException
exc
)
{
// Should not happen as distribution module creation previously succeeded in constructor
logger
.
log
(
BasicLevel
.
ERROR
,
"DistributionQueue.initialize prop = "
+
properties
,
exc
);
}
distributionModule
=
new
DistributionModule
(
this
,
(
Properties
)
properties
.
clone
());
}
}
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/DistributionTopic.java
View file @
7fff2e13
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2010
- 2011
ScalAgent Distributed Technologies
* Copyright (C) 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -77,12 +77,7 @@ public class DistributionTopic extends Topic {
public
void
initialize
(
boolean
firstTime
)
{
super
.
initialize
(
firstTime
);
if
(
distributionModule
==
null
)
{
try
{
distributionModule
=
new
DistributionModule
(
this
,
(
Properties
)
properties
.
clone
());
}
catch
(
RequestException
exc
)
{
// Should not happen as distribution module creation previously succeeded in constructor
logger
.
log
(
BasicLevel
.
ERROR
,
"DistributionTopic.initialize prop = "
+
properties
,
exc
);
}
distributionModule
=
new
DistributionModule
(
this
,
(
Properties
)
properties
.
clone
());
}
}
...
...
Write
Preview
Supports
Markdown
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