本文整理汇总了Java中flex.messaging.io.ArrayCollection类的典型用法代码示例。如果您正苦于以下问题:Java ArrayCollection类的具体用法?Java ArrayCollection怎么用?Java ArrayCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrayCollection类属于flex.messaging.io包,在下文中一共展示了ArrayCollection类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import flex.messaging.io.ArrayCollection; //导入依赖的package包/类
public void send(MessageSkeleton packet) {
Object response = null;
amfConnection.addHttpRequestHeader("Blazer", packet.getPacketString());
RemotingMessage message = new RemotingMessage();
message.setMessageId(flex.messaging.util.UUIDUtils.createUUID());
/*
* IMPORTANT!
* If your application uses customized invocation objects, modify the code below
*/
message.setDestination(packet.getDestination());
message.setOperation(packet.getOperation());
ArrayCollection arguments = new ArrayCollection();
Iterator parsIt = packet.getPars().iterator();
while (parsIt.hasNext()) {
arguments.add(parsIt.next());
}
message.setBody(arguments);
stdOut.println("[*] Sending AMF message with signature --> " + packet.getPacketString());
try {
response = amfConnection.call(packet.getDestination() + "." + packet.getOperation(), message);
} catch (ClientStatusException eClient) {
// Older versions of Adobe Flex libraries may return this client-side exception
stdErr.println("[!] ClientStatusException: " + eClient.toString().trim());
} catch (ServerStatusException eServer) {
stdErr.println("[!] ServerStatusException: " + eServer.toString().trim());
} catch (Exception eGeneric) {
stdErr.println("[!] Generic Exception: " + eGeneric.toString().trim());
} finally {
//In any case, dump the response
if (response != null) {
stdOut.println("\n[*] ---------------------------------------------------------");
stdOut.println(xstream.toXML(response));
stdOut.println("[*] ---------------------------------------------------------\n");
}
}
}
示例2: writeAMF3Collection
import flex.messaging.io.ArrayCollection; //导入依赖的package包/类
protected void writeAMF3Collection(Collection<?> c) throws IOException {
if (debugMore) debug("writeAMF3Collection(c=", c, ")");
ArrayCollection ac = (c instanceof ArrayCollection ? (ArrayCollection)c : new ArrayCollection(c));
writeAMF3Object(ac);
}