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
0d19fc01
Commit
0d19fc01
authored
Jul 09, 2020
by
Andre Freyssinet
Browse files
Adds dumpProperties MBean method.
parent
6910386d
Changes
8
Hide whitespace changes
Inline
Side-by-side
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AcquisitionQueue.java
View file @
0d19fc01
...
...
@@ -22,7 +22,10 @@
*/
package
org.objectweb.joram.mom.dest
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Set
;
import
org.objectweb.joram.mom.notifications.ClientMessages
;
import
org.objectweb.joram.shared.DestinationConstants
;
...
...
@@ -51,6 +54,33 @@ public class AcquisitionQueue extends Queue implements AcquisitionQueueMBean {
/** Stores the last set of properties defined. */
private
Properties
properties
;
public
String
dumpProperties
()
{
Set
<
Map
.
Entry
<
Object
,
Object
>>
entries
=
properties
.
entrySet
();
int
max
=
entries
.
size
()
-
1
;
if
(
max
==
-
1
)
return
"{}"
;
StringBuilder
sb
=
new
StringBuilder
();
Iterator
<
Map
.
Entry
<
Object
,
Object
>>
it
=
entries
.
iterator
();
sb
.
append
(
'{'
);
for
(
int
i
=
0
;
;
i
++)
{
Map
.
Entry
<
Object
,
Object
>
e
=
it
.
next
();
String
key
=
(
String
)
e
.
getKey
();
String
value
=
(
String
)
e
.
getValue
();
sb
.
append
(
key
.
toString
());
sb
.
append
(
'='
);
if
(
key
.
indexOf
(
"pass"
)
==
-
1
)
sb
.
append
(
value
.
toString
());
else
sb
.
append
(
"***"
);
if
(
i
==
max
)
return
sb
.
append
(
'}'
).
toString
();
sb
.
append
(
", "
);
}
}
/** Stores the id of the last message received to avoid duplicates. */
private
String
lastMessageId
;
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AcquisitionQueueMBean.java
View file @
0d19fc01
...
...
@@ -73,6 +73,9 @@ public interface AcquisitionQueueMBean extends QueueMBean, AcquisitionMBean {
*/
long
getPendingMin
();
public
String
dumpProperties
();
/**
* Starts the handler.
*/
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AcquisitionTopic.java
View file @
0d19fc01
...
...
@@ -22,7 +22,10 @@
*/
package
org.objectweb.joram.mom.dest
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Set
;
import
org.objectweb.joram.mom.notifications.ClientMessages
;
import
org.objectweb.joram.shared.DestinationConstants
;
...
...
@@ -51,6 +54,34 @@ public class AcquisitionTopic extends Topic implements AcquisitionTopicMBean {
/** Stores the last set of properties defined. */
private
Properties
properties
;
public
String
dumpProperties
()
{
Set
<
Map
.
Entry
<
Object
,
Object
>>
entries
=
properties
.
entrySet
();
int
max
=
entries
.
size
()
-
1
;
if
(
max
==
-
1
)
return
"{}"
;
StringBuilder
sb
=
new
StringBuilder
();
Iterator
<
Map
.
Entry
<
Object
,
Object
>>
it
=
entries
.
iterator
();
sb
.
append
(
'{'
);
for
(
int
i
=
0
;
;
i
++)
{
Map
.
Entry
<
Object
,
Object
>
e
=
it
.
next
();
String
key
=
(
String
)
e
.
getKey
();
String
value
=
(
String
)
e
.
getValue
();
sb
.
append
(
key
.
toString
());
sb
.
append
(
'='
);
if
(
key
.
indexOf
(
"pass"
)
==
-
1
)
sb
.
append
(
value
.
toString
());
else
sb
.
append
(
"***"
);
if
(
i
==
max
)
return
sb
.
append
(
'}'
).
toString
();
sb
.
append
(
", "
);
}
}
/** Stores the id of the last message received to avoid duplicates. */
private
String
lastMessageId
;
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AcquisitionTopicMBean.java
View file @
0d19fc01
...
...
@@ -26,5 +26,5 @@ package org.objectweb.joram.mom.dest;
* JMX interface for the monitoring topic.
*/
public
interface
AcquisitionTopicMBean
extends
TopicMBean
,
AcquisitionMBean
{
public
String
dumpProperties
();
}
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/DistributionQueue.java
View file @
0d19fc01
...
...
@@ -24,7 +24,9 @@ package org.objectweb.joram.mom.dest;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Set
;
import
org.objectweb.joram.mom.notifications.ClientMessages
;
import
org.objectweb.joram.mom.notifications.WakeUpNot
;
...
...
@@ -46,7 +48,7 @@ import fr.dyade.aaa.common.Debug;
* The {@link DistributionQueue} class implements the MOM distribution queue
* behavior, delivering messages via the {@link DistributionModule}.
*/
public
class
DistributionQueue
extends
Queue
{
public
class
DistributionQueue
extends
Queue
implements
DistributionQueueMBean
{
public
static
Logger
logger
=
Debug
.
getLogger
(
DistributionQueue
.
class
.
getName
());
/** Default period used to clean queue and re-distribute failing messages. */
...
...
@@ -77,6 +79,33 @@ public class DistributionQueue extends Queue {
private
boolean
isAsyncDistribution
;
private
Properties
properties
;
public
String
dumpProperties
()
{
Set
<
Map
.
Entry
<
Object
,
Object
>>
entries
=
properties
.
entrySet
();
int
max
=
entries
.
size
()
-
1
;
if
(
max
==
-
1
)
return
"{}"
;
StringBuilder
sb
=
new
StringBuilder
();
Iterator
<
Map
.
Entry
<
Object
,
Object
>>
it
=
entries
.
iterator
();
sb
.
append
(
'{'
);
for
(
int
i
=
0
;
;
i
++)
{
Map
.
Entry
<
Object
,
Object
>
e
=
it
.
next
();
String
key
=
(
String
)
e
.
getKey
();
String
value
=
(
String
)
e
.
getValue
();
sb
.
append
(
key
.
toString
());
sb
.
append
(
'='
);
if
(
key
.
indexOf
(
"pass"
)
==
-
1
)
sb
.
append
(
value
.
toString
());
else
sb
.
append
(
"***"
);
if
(
i
==
max
)
return
sb
.
append
(
'}'
).
toString
();
sb
.
append
(
", "
);
}
}
public
DistributionQueue
()
{
super
();
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/DistributionQueueMBean.java
0 → 100644
View file @
0d19fc01
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2020 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
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package
org.objectweb.joram.mom.dest
;
public
interface
DistributionQueueMBean
extends
QueueMBean
{
public
String
dumpProperties
();
}
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/DistributionTopic.java
View file @
0d19fc01
...
...
@@ -22,8 +22,11 @@
*/
package
org.objectweb.joram.mom.dest
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Set
;
import
org.objectweb.joram.mom.notifications.ClientMessages
;
import
org.objectweb.joram.mom.notifications.WakeUpNot
;
...
...
@@ -44,7 +47,7 @@ import fr.dyade.aaa.common.Debug;
* The {@link DistributionQueue} class implements the MOM distribution topic
* behavior, delivering messages via the {@link DistributionModule}.
*/
public
class
DistributionTopic
extends
Topic
{
public
class
DistributionTopic
extends
Topic
implements
DistributionTopicMBean
{
public
static
Logger
logger
=
Debug
.
getLogger
(
DistributionTopic
.
class
.
getName
());
...
...
@@ -58,6 +61,33 @@ public class DistributionTopic extends Topic {
private
Properties
properties
;
public
String
dumpProperties
()
{
Set
<
Map
.
Entry
<
Object
,
Object
>>
entries
=
properties
.
entrySet
();
int
max
=
entries
.
size
()
-
1
;
if
(
max
==
-
1
)
return
"{}"
;
StringBuilder
sb
=
new
StringBuilder
();
Iterator
<
Map
.
Entry
<
Object
,
Object
>>
it
=
entries
.
iterator
();
sb
.
append
(
'{'
);
for
(
int
i
=
0
;
;
i
++)
{
Map
.
Entry
<
Object
,
Object
>
e
=
it
.
next
();
String
key
=
(
String
)
e
.
getKey
();
String
value
=
(
String
)
e
.
getValue
();
sb
.
append
(
key
.
toString
());
sb
.
append
(
'='
);
if
(
key
.
indexOf
(
"pass"
)
==
-
1
)
sb
.
append
(
value
.
toString
());
else
sb
.
append
(
"***"
);
if
(
i
==
max
)
return
sb
.
append
(
'}'
).
toString
();
sb
.
append
(
", "
);
}
}
private
transient
DistributionDaemon
distributionDaemon
;
/**
...
...
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/DistributionTopicMBean.java
0 → 100644
View file @
0d19fc01
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2020 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
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package
org.objectweb.joram.mom.dest
;
public
interface
DistributionTopicMBean
extends
TopicMBean
{
public
String
dumpProperties
();
}
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