MCPcopy Create free account
hub / github.com/apache/tomcat / suspend

Method suspend

java/org/apache/tomcat/websocket/WsFrameBase.java:844–890  ·  view source on GitHub ↗

Suspends processing of this frame.

()

Source from the content-addressed store, hash-verified

842 * Suspends processing of this frame.
843 */
844 public void suspend() {
845 while (true) {
846 switch (readState) {
847 case WAITING:
848 if (!READ_STATE_UPDATER.compareAndSet(this, ReadState.WAITING, ReadState.SUSPENDING_WAIT)) {
849 continue;
850 }
851 return;
852 case PROCESSING:
853 if (!READ_STATE_UPDATER.compareAndSet(this, ReadState.PROCESSING, ReadState.SUSPENDING_PROCESS)) {
854 continue;
855 }
856 return;
857 case SUSPENDING_WAIT:
858 if (readState != ReadState.SUSPENDING_WAIT) {
859 continue;
860 } else {
861 if (getLog().isWarnEnabled()) {
862 getLog().warn(sm.getString("wsFrame.suspendRequested"));
863 }
864 }
865 return;
866 case SUSPENDING_PROCESS:
867 if (readState != ReadState.SUSPENDING_PROCESS) {
868 continue;
869 } else {
870 if (getLog().isWarnEnabled()) {
871 getLog().warn(sm.getString("wsFrame.suspendRequested"));
872 }
873 }
874 return;
875 case SUSPENDED:
876 if (readState != ReadState.SUSPENDED) {
877 continue;
878 } else {
879 if (getLog().isWarnEnabled()) {
880 getLog().warn(sm.getString("wsFrame.alreadySuspended"));
881 }
882 }
883 return;
884 case CLOSING:
885 return;
886 default:
887 throw new IllegalStateException(sm.getString("wsFrame.illegalReadState", state));
888 }
889 }
890 }
891
892 /**
893 * Resumes processing of this frame after suspension.

Callers

nothing calls this directly

Calls 4

getLogMethod · 0.95
isWarnEnabledMethod · 0.65
warnMethod · 0.65
getStringMethod · 0.65

Tested by

no test coverage detected