如果我已经有java使用spring和servlet容器的现有Web应用程序.将Akka整合到其中的正确方法是什么?
就像我将拥有Actor1并Actor2相互沟通一样.什么是开始使用这些演员的切入点?(比如:1.把它放在那里2.更改配置3.获取对actor的引用)
我找到了http://doc.akka.io/docs/akka/2.2-M3/general/configuration.html但是他没有给我提供胶水.只想获得整合的真实例子.
有一些简单的集成示例吗?
编辑: 应用程序执行一些搜索,从外部获取一些数据,将信息存储到文件.
应用程序非常大.有些组件/对象可以离开自己的生命,即直接客户端请求,它可以做一些并行的事情.就像一些具有可变状态的单例对象一样.
事情是我不知道我可以在哪里申请演员,我正在调查它.但我已经有很多同步块在这里和那里.
而且,我相信,已经有迹象表明演员可能会被应用.(因为我不确定,也许我忘了把一些同步,当然也没有集成测试)
关于配置,我只是不确定我是否应该配置一些application.conf让Actrors/Akka在那里生活(因为文档本身描述了它).
我所看到的:
@Component("someManager")
public class SomeManager {
List<Some> something; // mutable state, that why I use locks here.
// methods: add(), delete(), update()
}
Run Code Online (Sandbox Code Playgroud)
我能成功 SomeManagerActor
SomeManager用于controller.因此,拥有控制器Actor会很好吗?我希望收到(onReceive()方法的反馈).
这有点争议......这是我需要一些例子的另一个原因.
我相信我可以通过摆脱所有synchronized/whait/notify东西,将责任转移到演员,使用消息作为与他们之间的沟通方式来改进应用程序.
或者像这样,它可能是写入属性文件的actor:
编辑:
例如,现在我发现:为了使Actor1向Actor2发送消息,我使用了一个技巧:
// somewhere in existing code
public void …Run Code Online (Sandbox Code Playgroud) 我正在尝试将PayUMoney支付网关集成到我的客户端站点中.我的客户向我提供了PayUMoney的登录详细信息.我找到了商家钥匙但找不到两者中的任何一个:
PayUMoney为我提供了一个默认值的表单,但是当我测试时,它会给出消息:抱歉发生了一些错误.
这是表格:
<?php
// Merchant key here as provided by Payu
$MERCHANT_KEY = "JBZaLc";
// Merchant Salt as provided by Payu
$SALT = "GQs7yium";
// End point - change to https://secure.payu.in for LIVE mode
$PAYU_BASE_URL = "https://test.payu.in";
$action = '';
$posted = array();
if(!empty($_POST)) {
//print_r($_POST);
foreach($_POST as $key => $value) {
$posted[$key] = $value;
}
}
$formError = 0;
if(empty($posted['txnid'])) {
// Generate random transaction id
$txnid = substr(hash('sha256', …Run Code Online (Sandbox Code Playgroud) 我正在尝试设置Weblogic Server 10.3(和Portal等)以使用maven作为构建工具.我试图找到一个体面的教程或文档如何做到这一点.有一些教程适用于9.0等旧版本,但版本10的信息很少.
我正在寻找一种用maven构建weblogic的ear文件的方法.人们真的这样做吗?使用maven值得麻烦吗?
我想使用maven以便更容易地与Hudson等持续集成工具集成.
编辑:似乎有一种直接导出maven文件的方法http://edocs.bea.com/wlw/docs102/guide/ideuserguide/build/conMavenScript.html.但这些文件是蚂蚁的简单包装器.
很难看出StringTemplate如何轻松(或不)与流行的 Java Web MVC框架集成.
哪些Java MVC框架可以与StringTemplate轻松集成?
一个很好的答案:
读者/选民,如果你知道这是真的和伟大的,请投票寻找解决方案.
在这个问题的范围内,我对除StringTemplate之外的任何其他模板引擎都不感兴趣.
我正在尝试集成Spring Security和GWT.我也在使用gwt-incubator-security.我按照wiki页面上的描述配置了所有内容.我设法通过使用intercept-url来获得安全性,但我无法使用注释使其工作.关于问题是什么的任何想法?
PS我使用的是Spring 2.5.6,Spring Security 2.0.5和gwt-incubator-security 1.0.1.欢迎任何有用的链接和评论.
这是我的配置文件
applicationContext.xml中
<?xml version="1.0" encoding="UTF-8"?>
<global-method-security secured-annotations="enabled"
jsr250-annotations="disabled" />
<http auto-config="true">
<!-- <intercept-url pattern="/**/*.rpc" access="ROLE_USER" /> -->
<intercept-url pattern="/gwt/**" access="ROLE_USER" />
<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
</http>
<authentication-provider>
<user-service>
<user name="rod" password="koala"
authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
<user name="dianne" password="emu" authorities="ROLE_USER,ROLE_TELLER" />
<user name="scott" password="wombat" authorities="ROLE_USER" />
<user name="peter" password="opal" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
<beans:bean id="greetService" class="com.ct.test.server.GreetingServiceImpl" />
Run Code Online (Sandbox Code Playgroud)
web.xml中
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Spring_test.html</welcome-file>
</welcome-file-list>
<!-- Spring related …Run Code Online (Sandbox Code Playgroud) 我有一个商家帐户名为CommWeb整合和我发送一个SSL讯息到他们的URL(https://migs.mastercard.com.au/vpcdps).当我尝试发送帖子时,我得到以下异常:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud)
执行帖子的代码(我没有编写,代码库中已经存在的代码)是:
public static HttpResponse sendHttpPostSSL(String url, Map<String, String> params) throws IOException {
PostMethod postMethod = new PostMethod(url);
for (Map.Entry<String, String> entry : params.entrySet()) {
postMethod.addParameter(entry.getKey(), StringUtils.Nz(entry.getValue()));
}
HttpClient client = new HttpClient();
int status = client.executeMethod(postMethod);
if (status == 200) {
StringBuilder resultBuffer = new StringBuilder();
resultBuffer.append(postMethod.getResponseBodyAsString());
return new HttpResponse(resultBuffer.toString(), "");
} else {
throw new IOException("Invalid response code: " + status); …Run Code Online (Sandbox Code Playgroud) 我正在尝试用PHP开发一个应用程序.
这个应用程序有两种可能的开发方式.第一个是尝试直接在浏览器上执行像www.picnik.com这样的图像处理.另一种是开发CBIR(内容库图像检索)算法.
那么,是否可以将图像从PHP脚本发送到OpenCV程序?甚至可以实时显示被操作的图像?
谢谢.
我正在尝试设置phing以使用travis-ci,但是我无法让它运行安装脚本来安装所有依赖项.
我的.travis.yml文件是:
language: php
php:
- 5.2
script: ./.travis-phing.sh
Run Code Online (Sandbox Code Playgroud)
在travis中,我收到错误:
/home/travis/build.sh: line 105: ./.travis-phing.sh: Permission denied
Run Code Online (Sandbox Code Playgroud)
是什么造成的?
我正在尝试使用gradle的-Dtest.single标志运行单个集成测试.我添加了另一个源集,src/integrationTest并将测试放在那里.我有一个集成测试任务
task integrationTests(type: Test) {
dependsOn 'assemble', 'integrationTestClasses'
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
}
Run Code Online (Sandbox Code Playgroud)
运行正常,但如果我尝试运行单个测试,它告诉我它找不到匹配的测试.我不希望每次编写新的测试时都要运行每个集成测试.有没有办法做到这一点?
我们的工作室最近开始采用SOA方法进行应用程序开发.我们看到SOA /微服务的关注点,可重用性和其他好处的分离带来了很多好处.
但是,我们坚持的一个重要项目是跨服务聚合,过滤和分页结果.让我用场景描述问题.
假设我们有3项服务:
现在,假设我们要构建一个可以汇总显示/报告多个服务的报告/管理工具.例如,我们希望显示付款的分页列表,以及每笔付款所针对的人员和项目.这非常简单:获取付款清单,然后查询PersonService和ItemService以获取相应的Person和Item记录.
但是,当我们想要过滤掉这些数据时,问题就会发挥作用:例如,显示由名为"Bob"的人制作的分段付款清单,他们购买了"Car"项.这使得事情变得更加复杂,因为我们需要从3个不同的服务中过滤结果,而不知道每个服务将返回多少结果.
从性能的角度来看,一遍又一遍地查询所有服务以缩小结果将是代价高昂的,所以我一直在研究更好的解决方案.但是,我找不到解决这个问题的具体方法(或者至少是"最佳实践").在单个应用程序中,我们只是在不同的表中使用SQL连接.我在确定如何/如果在服务之间可能出现类似情况时遇到了很多麻烦.
我对社区的问题是:你的方法是什么?我考虑过的事情: