Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CSCWebsocketBean
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TongZuu
CSCWebsocketBean
Commits
725d39d6
Commit
725d39d6
authored
Jun 04, 2016
by
TongZuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify response data to array [requestid , ResponseWebsocket]
parent
d2e9ce34
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
2 deletions
+33
-2
.gitignore
com/csc/library/factory/.gitignore
+1
-0
HandlePackageFactory.java
com/csc/library/factory/HandlePackageFactory.java
+26
-0
ResponseFactory.java
com/csc/library/factory/ResponseFactory.java
+4
-1
HandleMessageData.java
com/csc/library/properties/HandleMessageData.java
+1
-1
SessionHandle.java
com/csc/library/properties/SessionHandle.java
+1
-0
No files found.
com/csc/library/factory/.gitignore
View file @
725d39d6
...
...
@@ -12,3 +12,4 @@
/CommandFactory$CMDSpecialBuilder.class
/CMDModeFactory.class
/ThreadsPoolsFactory$1.class
/HandlePackageFactory.class
com/csc/library/factory/HandlePackageFactory.java
0 → 100644
View file @
725d39d6
package
com
.
csc
.
library
.
factory
;
import
javax.websocket.Session
;
import
com.csc.library.properties.HandleMessageData
;
import
com.csc.library.properties.HandlePackage
;
public
class
HandlePackageFactory
{
private
static
HandlePackageFactory
instance
=
null
;
private
HandlePackage
handle
=
null
;
private
HandlePackageFactory
(){
handle
=
new
HandleMessageData
();
}
public
static
HandlePackageFactory
getInstance
(){
if
(
instance
==
null
){
instance
=
new
HandlePackageFactory
();
}
return
instance
;
}
public
HandlePackage
getHandlePackage
(){
return
handle
;
}
}
com/csc/library/factory/ResponseFactory.java
View file @
725d39d6
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.Map
;
import
com.csc.library.properties.CscSession
;
import
com.csc.library.properties.HandlePackage
;
import
com.csc.library.properties.ResponsePools
;
import
com.csc.library.request.CommandState
;
import
com.csc.library.request.RequestWebsocket
;
...
...
@@ -21,6 +22,7 @@ public class ResponseFactory {
//private Map<CscSession,List<ResponseWebsocket>> response = new HashMap<CscSession ,List<ResponseWebsocket>>();
private
ResponsePools
<
ResponsePropertiesImpl
>
response
;
private
PropertiesFactory
propInstance
;
private
HandlePackage
handle
;
private
ResponseFactory
(){
}
...
...
@@ -30,6 +32,7 @@ public class ResponseFactory {
instance
=
new
ResponseFactory
();
instance
.
propInstance
=
PropertiesFactory
.
getInstance
();
instance
.
response
=
ResponsePools
.
getInstance
();
instance
.
handle
=
HandlePackageFactory
.
getInstance
().
getHandlePackage
();
}
return
instance
;
}
...
...
@@ -67,7 +70,7 @@ public class ResponseFactory {
}
protected
void
sendResponse
(
CscSession
session
,
ResponseWebsocket
res
){
session
.
sendMessage
(
propInstance
.
toJson
(
res
)
);
PackageDataFactory
.
getInstance
().
sendData
(
session
,
this
.
handle
,
res
);
res
.
clear
();
this
.
response
.
push
((
ResponsePropertiesImpl
)
res
);
}
...
...
com/csc/library/properties/HandleMessageData.java
View file @
725d39d6
...
...
@@ -33,7 +33,7 @@ public class HandleMessageData implements HandlePackage<CscSession>{
@Override
public
void
send
(
CscSession
session
,
String
jsonSting
)
{
session
.
sendMessage
(
jsonSting
);
}
}
com/csc/library/properties/SessionHandle.java
View file @
725d39d6
...
...
@@ -4,6 +4,7 @@ import java.io.IOException;
import
javax.websocket.Session
;
import
com.csc.library.factory.PackageDataFactory
;
import
com.csc.library.response.ResponseWebsocket
;
import
com.csc.library.utilities.UProfile
;
...
...
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