Skip to content

Conversation

@PhilSk
Copy link

@PhilSk PhilSk commented Apr 18, 2016

No description provided.

@Override
public void onMessage(Message msg) {
log.info("Message received: {}", msg);
switch (msg.getType().toString()) {
Copy link
Owner

@arhangeldim arhangeldim Apr 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Он же специально enum, чтобы не сравнивать строки

switch (msg.getType()) {
  case MSG_STATUS:
    ...

switch (type) {
case "MSG_LOGIN":
LoginMessage loginMessage = (LoginMessage) msg;
StatusMessage statusMessage = null;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот код должен быть в хэндлере, а не здесь. Посмотрите интерфейс Command

final String ATTR_REF = "ref";
final String ATTR_BEAN_ID = "id";
final String ATTR_BEAN_CLASS = "class";
final String tagBean = "bean";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я же написал комент по этому поводу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants