Skip to content
Permalink
Browse files
add apache-2.0 license header and formatting
fixed #4
  • Loading branch information
DLive committed May 21, 2019
1 parent 59500ad commit e283e75dc89731fd5c5e140516626311b56d8e79
Showing 79 changed files with 2,633 additions and 1,999 deletions.

This file was deleted.

@@ -6,8 +6,6 @@
%%% @end
%%% Created : 14. 十月 2016 下午4:29
%%%-------------------------------------------------------------------
-author("dlive").

-ifdef(DEBUG).
-define(RELOADER,true).
-else.
@@ -6,7 +6,7 @@
%%% @end
%%% Created : 16. 十月 2016 下午11:38
%%%-------------------------------------------------------------------
-author("dlive").


-include("hessian.hrl").

@@ -6,8 +6,5 @@
%%% @end
%%% Created : 15. Apr 2018 9:10 PM
%%%-------------------------------------------------------------------
-author("dlive").


-type response_content() :: binary().

@@ -6,9 +6,6 @@
%%% @end
%%% Created : 22. Mar 2018 6:53 PM
%%%-------------------------------------------------------------------
-author("dlive").


-define(PROVIDER_IMPL_TABLE,provider_impl_table).

-define(PROVIDER_WORKER,provider_worker).
@@ -6,8 +6,6 @@
%%% @end
%%% Created : 09. Mar 2018 11:10 PM
%%%-------------------------------------------------------------------
-author("dlive").

-record(null_pointer_exception,{detailMessage,cause,stackTrace,suppressedExceptions}).

-record(stack_stack_trace_element,{declaringClass,methodName,fileName,lineNumber}).
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service;

import org.apache.dubbo.erlang.sample.service.bean.UserInfo;
@@ -8,14 +25,12 @@

/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args ) throws IOException {
public class App {
public static void main(String[] args) throws IOException {
System.out.println("将要监听服务");
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
new String[] { "applicationProvider.xml" });
new String[]{"applicationProvider.xml"});
context.start();
UserOperator userOperator = (UserOperator) context.getBean("userInterface");
UserInfo result = userOperator.getUserInfo("hh-bb");
@@ -1,22 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

/**
* Created by dlive on 2018/9/12.
*/
public class AppListMain {

public static void main( String[] args ) throws IOException {
System.out.println("将要监听服务");
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
new String[] { "applicationProvider.xml" });
context.start();
// UserOperator user = (UserOperator) context.getBean("userInterface");
// UserRes result = user.queryUserList("listquery");
// System.out.println("result:" + result.getUserlist().get(0).getUserName());

System.out.println("按任意键退出");
System.in.read();
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service.bean;

import java.io.Serializable;
@@ -1,8 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service.bean;

/**
* Created by dlive on 2018/9/12.
*/
public class UserInfoRequest {
public String requestId;
public String username;
@@ -1,10 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service.bean;

import java.util.List;

/**
* Created by dlive on 2018/9/12.
*/
public class UserRes {
private String message;
private Integer code;
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service.facade;

import org.apache.dubbo.erlang.sample.service.bean.UserInfo;
@@ -6,8 +23,11 @@

public interface UserOperator {
public String genUserId();

public UserInfo getUserInfo(String userid);

public UserInfo queryUserInfo(UserInfoRequest request);

public UserRes queryUserList(String info);

}
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service.impl;

import org.apache.dubbo.erlang.sample.service.bean.UserInfo;
@@ -24,7 +41,7 @@ public UserInfo getUserInfo(String userid) {
@Override
public UserInfo queryUserInfo(UserInfoRequest request) {

System.out.println("request:"+request.getRequestId());
System.out.println("request:" + request.getRequestId());
UserInfo info = new UserInfo();
info.setUserAge(99);
info.setUserId("id123");
@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="hello-world" /><!-- 注册地址 -->
<dubbo:registry address="zookeeper://127.0.0.1:2181" />
<dubbo:protocol name="dubbo" port="20880" />

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="hello-world"/><!-- 注册地址 -->
<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
<dubbo:protocol name="dubbo" port="20880"/>


<dubbo:consumer check="false" timeout="300000" id="dubboConsumerConfig" retries="0"/>

<bean id="userService" class="org.apache.dubbo.erlang.sample.service.impl.UserOperatorImpl" />
<dubbo:service interface="org.apache.dubbo.erlang.sample.service.facade.UserOperator" ref="userService"/>
<bean id="userService" class="org.apache.dubbo.erlang.sample.service.impl.UserOperatorImpl"/>
<dubbo:service interface="org.apache.dubbo.erlang.sample.service.facade.UserOperator" ref="userService"/>

<!-- <dubbo:reference id="userInterface" interface="UserOperator" retries="0" />-->
<!-- <dubbo:reference id="userInterface" interface="UserOperator" retries="0" />-->
</beans>
@@ -1,5 +1,4 @@
log4j.rootLogger=DEBUG,console

log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.Threshold=DEBUG
#log4j.appender.console.ImmediateFlush=true
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.dubbo.erlang.sample.service;

import static org.junit.Assert.assertTrue;
@@ -7,14 +24,12 @@
/**
* Unit test for simple App.
*/
public class AppTest
{
public class AppTest {
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
public void shouldAnswerWithTrue() {
assertTrue(true);
}
}

0 comments on commit e283e75

Please sign in to comment.