14 changed files with 123 additions and 25 deletions
-
2src/main/java/com/corundumstudio/socketio/AckCallback.java
-
8src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java
-
35src/main/java/com/corundumstudio/socketio/MultiTypeAckCallback.java
-
37src/main/java/com/corundumstudio/socketio/MultiTypeArgs.java
-
13src/main/java/com/corundumstudio/socketio/ack/AckManager.java
-
6src/main/java/com/corundumstudio/socketio/parser/AckArgs.java
-
2src/main/java/com/corundumstudio/socketio/parser/Decoder.java
-
2src/main/java/com/corundumstudio/socketio/parser/Encoder.java
-
6src/main/java/com/corundumstudio/socketio/parser/Event.java
-
23src/main/java/com/corundumstudio/socketio/parser/JacksonJsonSupport.java
-
4src/main/java/com/corundumstudio/socketio/parser/JsonSupport.java
-
6src/main/java/com/corundumstudio/socketio/parser/Packet.java
-
2src/test/java/com/corundumstudio/socketio/parser/DecoderAckPacketTest.java
-
2src/test/java/com/corundumstudio/socketio/parser/EncoderAckPacketTest.java
@ -0,0 +1,35 @@ |
|||
/** |
|||
* Copyright 2012 Nikita Koksharov |
|||
* |
|||
* Licensed under the Apache License, Version 2.0 (the "License"); |
|||
* you may not use this file except in compliance with the License. |
|||
* You may obtain a copy of the License at |
|||
* |
|||
* http://www.apache.org/licenses/LICENSE-2.0 |
|||
* |
|||
* Unless required by applicable law or agreed to in writing, software |
|||
* distributed under the License is distributed on an "AS IS" BASIS, |
|||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
* See the License for the specific language governing permissions and |
|||
* limitations under the License. |
|||
*/ |
|||
package com.corundumstudio.socketio; |
|||
|
|||
/** |
|||
* Multi type ack callback used in case of multiple ack arguments |
|||
* |
|||
*/ |
|||
public abstract class MultiTypeAckCallback extends AckCallback<MultiTypeArgs> { |
|||
|
|||
private Class<?>[] resultClasses; |
|||
|
|||
public MultiTypeAckCallback(Class<?> ... resultClasses) { |
|||
super(MultiTypeArgs.class); |
|||
this.resultClasses = resultClasses; |
|||
} |
|||
|
|||
public Class<?>[] getResultClasses() { |
|||
return resultClasses; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
/** |
|||
* Copyright 2012 Nikita Koksharov |
|||
* |
|||
* Licensed under the Apache License, Version 2.0 (the "License"); |
|||
* you may not use this file except in compliance with the License. |
|||
* You may obtain a copy of the License at |
|||
* |
|||
* http://www.apache.org/licenses/LICENSE-2.0 |
|||
* |
|||
* Unless required by applicable law or agreed to in writing, software |
|||
* distributed under the License is distributed on an "AS IS" BASIS, |
|||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
* See the License for the specific language governing permissions and |
|||
* limitations under the License. |
|||
*/ |
|||
package com.corundumstudio.socketio; |
|||
|
|||
import java.util.List; |
|||
|
|||
public class MultiTypeArgs { |
|||
|
|||
private final List<Object> args; |
|||
|
|||
public MultiTypeArgs(List<Object> args) { |
|||
super(); |
|||
this.args = args; |
|||
} |
|||
|
|||
public List<Object> getArgs() { |
|||
return args; |
|||
} |
|||
|
|||
public <T> T get(int index) { |
|||
return (T) args.get(0); |
|||
} |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue