-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from clearlydecoded/development
Fixes for version 2.0.0
- Loading branch information
Showing
4 changed files
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
* @author Yaakov Chaikin ([email protected]) | ||
*/ | ||
@Service | ||
public class GingerCookieOrderHandler extends | ||
public class GingerCookieOrderProcessor extends | ||
AbstractMessageProcessor<GingerCookieOrder, GingerCookieOrderResponse> { | ||
|
||
@SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
*/ | ||
package com.clearlydecoded.messenger.demo.processor; | ||
|
||
import com.clearlydecoded.messenger.MessageProcessor; | ||
import com.clearlydecoded.messenger.AbstractMessageProcessor; | ||
import com.clearlydecoded.messenger.demo.message.GreetMeMessage; | ||
import com.clearlydecoded.messenger.demo.message.GreetMeMessageResponse; | ||
import org.springframework.stereotype.Service; | ||
|
@@ -19,31 +19,13 @@ | |
* @author Yaakov Chaikin ([email protected]) | ||
*/ | ||
@Service // Must have this annotation for Spring to discover the class | ||
public class GreetMeMessageProcessor implements | ||
MessageProcessor<GreetMeMessage, GreetMeMessageResponse> { | ||
public class GreetMeMessageProcessor extends | ||
AbstractMessageProcessor<GreetMeMessage, GreetMeMessageResponse> { | ||
|
||
@Override | ||
public GreetMeMessageResponse process(GreetMeMessage message) { | ||
|
||
// This is where you write the actual business logic | ||
return new GreetMeMessageResponse("Hello " + message.getMyName()); | ||
} | ||
|
||
@Override | ||
public String getCompatibleMessageType() { | ||
// SEE! Defining that TYPE as public static final paid off! | ||
// You certainly CAN just hardcode a string here, but this is more robust. | ||
// Don't worry, if you mess this up, the validation at startup will catch it | ||
return GreetMeMessage.TYPE; | ||
} | ||
|
||
@Override | ||
public Class<GreetMeMessage> getCompatibleMessageClassType() { | ||
return GreetMeMessage.class; // not possible to mess up here | ||
} | ||
|
||
@Override | ||
public Class<GreetMeMessageResponse> getCompatibleMessageResponseClassType() { | ||
return GreetMeMessageResponse.class; // not possible to mess up here | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
* @author Yaakov Chaikin ([email protected]) | ||
*/ | ||
@Service | ||
public class MaxSugarOrderHandler extends | ||
public class MaxSugarOrderProcessor extends | ||
AbstractMessageProcessor<MaxSugarOrder, MaxSugarOrderResponse> { | ||
|
||
@SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
*/ | ||
package com.clearlydecoded.messenger.demo.processor; | ||
|
||
import com.clearlydecoded.messenger.AbstractMessageProcessor; | ||
import com.clearlydecoded.messenger.MessageProcessor; | ||
import com.clearlydecoded.messenger.demo.message.SugarComaCookieOrder; | ||
import com.clearlydecoded.messenger.demo.message.SugarComaCookieOrderResponse; | ||
import com.clearlydecoded.messenger.demo.model.Cookie; | ||
|
@@ -22,9 +22,9 @@ | |
* | ||
* @author Yaakov Chaikin ([email protected]) | ||
*/ | ||
@Service | ||
public class SugarComaCookieOrderProcessor extends | ||
AbstractMessageProcessor<SugarComaCookieOrder, SugarComaCookieOrderResponse> { | ||
@Service // Must have this annotation for Spring to discover the class | ||
public class SugarComaCookieOrderProcessor implements | ||
MessageProcessor<SugarComaCookieOrder, SugarComaCookieOrderResponse> { | ||
|
||
@SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") | ||
@Autowired | ||
|
@@ -33,7 +33,26 @@ public class SugarComaCookieOrderProcessor extends | |
|
||
@Override | ||
public SugarComaCookieOrderResponse process(SugarComaCookieOrder message) { | ||
// This is where you write the actual business logic | ||
Cookie comaCookie = cookieStoreService.giveMeSugarComaCookie(); | ||
return new SugarComaCookieOrderResponse(comaCookie); | ||
} | ||
|
||
@Override | ||
public String getCompatibleMessageType() { | ||
// SEE! Defining that TYPE as public static final paid off! | ||
// You certainly CAN just hardcode a string here, but this is more robust. | ||
// Don't worry, if you mess this up, the validation at startup will catch it | ||
return SugarComaCookieOrder.TYPE; | ||
} | ||
|
||
@Override | ||
public Class<SugarComaCookieOrder> getCompatibleMessageClassType() { | ||
return SugarComaCookieOrder.class; // not possible to mess up here | ||
} | ||
|
||
@Override | ||
public Class<SugarComaCookieOrderResponse> getCompatibleMessageResponseClassType() { | ||
return SugarComaCookieOrderResponse.class; // not possible to mess up here | ||
} | ||
} |