<html>
<head>
<base href="http://www.jacorb.org/bugzilla/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Notification Service filter"
href="http://www.jacorb.org/bugzilla/show_bug.cgi?id=989">989</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Notification Service filter
</td>
</tr>
<tr>
<th>Product</th>
<td>JacORB
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>major
</td>
</tr>
<tr>
<th>Priority</th>
<td>P5
</td>
</tr>
<tr>
<th>Component</th>
<td>ORB
</td>
</tr>
<tr>
<th>Assignee</th>
<td>jacorb-bugs@lists.spline.inf.fu-berlin.de
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dlh.zhangtao@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=441" name="attach_441" title="notification service as server push_consumer">attachment 441</a> <a href="attachment.cgi?id=441&action=edit" title="notification service as server push_consumer">[details]</a></span>
notification service as server push_consumer
1、set notification service filter for example :
<constrainList>
<org.omg.CosNotifyFilter.ConstraintExp>
<event__types>
<org.omg.CosNotification.EventType>
<domain__name>TMN</domain__name>
<type__name>*</type__name>
</org.omg.CosNotification.EventType>
</event__types>
<constraint__expr>( $severity == 5 )</constraint__expr>
</org.omg.CosNotifyFilter.ConstraintExp>
</constrainList>
2、java programe for example:
int redefineSeverity = 5;
Any redefineSeverityAny = getOrb().create_any();
// redefineSeverityAny.insert_long(redefineSeverity);
SeverityTypeHelper.insert(redefineSeverityAny,SeverityType.from_int(redefineSeverity));
alarmNotifyEvent.filterable_data[6] = new Property("severity",
redefineSeverityAny);
SeverityTypeHelper.class by IDL for example :
package npInterface;
/**
* Generated from IDL enum "SeverityType".
*
* @author JacORB IDL compiler V 3.4
* @version generated at 2014-4-9 15:58:20
*/
public abstract class SeverityTypeHelper
{
private volatile static org.omg.CORBA.TypeCode _type;
public static org.omg.CORBA.TypeCode type ()
{
if (_type == null)
{
synchronized(SeverityTypeHelper.class)
{
if (_type == null)
{
_type =
org.omg.CORBA.ORB.init().create_enum_tc(npInterface.SeverityTypeHelper.id(),"SeverityType",new
String[]{"CLEARED","INDETERMINATED","WARNING","MINOR","MAJOR","CRITICAL"});
}
}
}
return _type;
}
public static void insert (final org.omg.CORBA.Any any, final
npInterface.SeverityType s)
{
any.type(type());
write( any.create_output_stream(),s);
}
public static npInterface.SeverityType extract (final org.omg.CORBA.Any
any)
{
org.omg.CORBA.portable.InputStream in = any.create_input_stream();
try
{
return read (in);
}
finally
{
try
{
in.close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString()
);
}
}
}
public static String id()
{
return "IDL:npInterface/SeverityType:1.0";
}
public static SeverityType read (final org.omg.CORBA.portable.InputStream
in)
{
return SeverityType.from_int(in.read_long());
}
public static void write (final org.omg.CORBA.portable.OutputStream out,
final SeverityType s)
{
out.write_long(s.value());
}
}
////////////////////////////////////////
SeverityType.class by IDL for example :
package npInterface;
/**
* Generated from IDL enum "SeverityType".
*
* @author JacORB IDL compiler V 3.4
* @version generated at 2014-4-9 15:58:20
*/
public final class SeverityType
implements org.omg.CORBA.portable.IDLEntity
{
/** Serial version UID. */
private static final long serialVersionUID = 1L;
private int value = -1;
public static final int _CLEARED = 0;
public static final SeverityType CLEARED = new SeverityType(_CLEARED);
public static final int _INDETERMINATED = 1;
public static final SeverityType INDETERMINATED = new
SeverityType(_INDETERMINATED);
public static final int _WARNING = 2;
public static final SeverityType WARNING = new SeverityType(_WARNING);
public static final int _MINOR = 3;
public static final SeverityType MINOR = new SeverityType(_MINOR);
public static final int _MAJOR = 4;
public static final SeverityType MAJOR = new SeverityType(_MAJOR);
public static final int _CRITICAL = 5;
public static final SeverityType CRITICAL = new SeverityType(_CRITICAL);
public int value()
{
return value;
}
public static SeverityType from_int(int value)
{
switch (value) {
case _CLEARED: return CLEARED;
case _INDETERMINATED: return INDETERMINATED;
case _WARNING: return WARNING;
case _MINOR: return MINOR;
case _MAJOR: return MAJOR;
case _CRITICAL: return CRITICAL;
default: throw new org.omg.CORBA.BAD_PARAM();
}
}
public String toString()
{
switch (value) {
case _CLEARED: return "CLEARED";
case _INDETERMINATED: return "INDETERMINATED";
case _WARNING: return "WARNING";
case _MINOR: return "MINOR";
case _MAJOR: return "MAJOR";
case _CRITICAL: return "CRITICAL";
default: throw new org.omg.CORBA.BAD_PARAM();
}
}
protected SeverityType(int i)
{
value = i;
}
/**
* Designate replacement object when deserialized from stream. See
* <a href="http://www.omg.org/docs/ptc/02-01-03.htm#Issue4271">http://www.omg.org/docs/ptc/02-01-03.htm#Issue4271</a>
*
* @throws java.io.ObjectStreamException
*/
java.lang.Object readResolve()
throws java.io.ObjectStreamException
{
return from_int(value());
}
}
Quesstion:
(1)run : ntfy -port 9001
(2)run : java programe
then:
ntfy find error for example :
zhangtao@zhangtao-Lenovo-V480:~$ ntfy -port 9001
INFO Initialising ORB with ID:
INFO InterceptorManager started with 0 Server Interceptors, 0 Client
Interceptors and 1 IOR Interceptors
INFO oid: 5F 45 43 46 61 63 74 6F 72 79
_ECFactoryobject is activated
INFO Using server ID (2358635612) for transient POA
INFO ClientConnectionManager: created new ClientGIOPConnection to
10.31.4.7:9001 (53c04c06)
INFO ORB run
INFO Opened new server-side TCP/IP transport to 10.31.4.7:54449
INFO EventReliability=BestEffort
INFO ConnectionReliability=BestEffort
INFO oid: 00 01 2B 46 49 4B 40 3C 24 24 3D 07 1F 1F 2A 46 24 28 1F
..+FIK@<$$=...*F$(.object is activated
INFO Using server ID (2358635612) for transient POA
INFO oid: 01 01 2B 46 49 4B 40 3C 24 24 3D 07 1F 1F 2A 46 24 28 1F
..+FIK@<$$=...*F$(.object is activated
INFO set MaxNumberOfConsumers=0
INFO set MaxNumberOfSuppliers=0
INFO oid: 02 01 2B 46 49 4B 40 3C 24 24 3D 07 1F 1F 2A 46 24 28 1F
..+FIK@<$$=...*F$(.object is activated
INFO oid: 03 01 2B 46 49 4B 40 3C 24 24 3D 07 1F 1F 2A 46 24 28 1F
..+FIK@<$$=...*F$(.object is activated
INFO create TaskProcessor
INFO set Error Threshold to : 3
INFO oid: 04 01 2B 46 49 4B 40 3C 24 24 3D 07 1F 1F 2A 46 24 28 1F
..+FIK@<$$=...*F$(.object is activated
INFO ClientConnectionManager: found ClientGIOPConnection to 10.31.4.7:9001
(53c04c06)
INFO Created filter for Grammar: EXTENDED_TCL
INFO oid: 05 01 2B 46 49 4B 40 3C 24 24 3D 07 1F 1F 2A 46 24 28 1F
..+FIK@<$$=...*F$(.object is activated
INFO ClientConnectionManager: found ClientGIOPConnection to 10.31.4.7:9001
(53c04c06)
INFO set QoS: StartTimeSupported=true
INFO set QoS: StopTimeSupported=true
INFO set QoS: StartTimeSupported=true
INFO set QoS: StopTimeSupported=true
INFO oid: 06 01 2B 46 49 4B 40 3C 24 24 3D 07 1F 1F 2A 46 24 28 1F
..+FIK@<$$=...*F$(.object is activated
INFO ClientConnectionManager: found ClientGIOPConnection to 10.31.4.7:9001
(53c04c06)
INFO connect sequence_push_supplier
WARNING unexpected error during match. match result defaults to false
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy1.match_structured(Unknown Source)
at
org.omg.CosNotifyFilter.FilterPOATie.match_structured(FilterPOATie.java:82)
at
org.omg.CosNotifyFilter._FilterStub.match_structured(_FilterStub.java:554)
at
org.jacorb.notification.StructuredEventMessage.match(StructuredEventMessage.java:263)
at org.jacorb.notification.AbstractMessage.match(AbstractMessage.java:553)
at
org.jacorb.notification.AbstractMessage$MessageHandle.match(AbstractMessage.java:241)
at
org.jacorb.notification.engine.FilterProxySupplierTask.filter(FilterProxySupplierTask.java:221)
at
org.jacorb.notification.engine.FilterProxySupplierTask.doFilter(FilterProxySupplierTask.java:117)
at
org.jacorb.notification.engine.AbstractFilterTask.doWork(AbstractFilterTask.java:76)
at org.jacorb.notification.engine.AbstractTask.run(AbstractTask.java:63)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.jacorb.notification.filter.AbstractFilterUsageDecorator$FilterInvocationHandler.invoke(AbstractFilterUsageDecorator.java:58)
... 13 more
Caused by: org.omg.CORBA.BAD_OPERATION: Cannot extract long
at org.jacorb.orb.Any.checkExtract(Any.java:118)
at org.jacorb.orb.Any.extract_long(Any.java:372)
at
org.jacorb.notification.filter.EvaluationResult.getLong(EvaluationResult.java:255)
at
org.jacorb.notification.filter.EvaluationResult.compareTo(EvaluationResult.java:451)
at
org.jacorb.notification.filter.etcl.EqOperator.evaluate(EqOperator.java:44)
at
org.jacorb.notification.filter.etcl.BinaryOperator.evaluate(BinaryOperator.java:46)
at
org.jacorb.notification.filter.etcl.UnaryOperator.evaluate(UnaryOperator.java:43)
at
org.jacorb.notification.filter.etcl.ETCLFilterConstraint.evaluate(ETCLFilterConstraint.java:92)
at
org.jacorb.notification.filter.AbstractFilter.match_NoLock(AbstractFilter.java:707)
at
org.jacorb.notification.filter.AbstractFilter.match_ReadLock(AbstractFilter.java:688)
at
org.jacorb.notification.filter.AbstractFilter.match_structured_internal(AbstractFilter.java:795)
at
org.jacorb.notification.filter.AbstractFilter.match_structured(AbstractFilter.java:776)
... 18 more
Now : I can sure the quesstion is
"SeverityTypeHelper.insert(redefineSeverityAny,SeverityType.from_int(redefineSeverity));"
I hope anyone give some help!!!</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>