ylbtech-Java-Class-@I:javax.annotation.PostConstruct
1.返回顶部
 
2.返回顶部
1.1、
package com.ylbtech.api.platform.controller.pay;

import com.egzosn.pay.ali.api.AliPayConfigStorage;
import com.egzosn.pay.ali.api.AliPayService;
import com.egzosn.pay.ali.bean.AliTransactionType;
import com.egzosn.pay.common.api.PayService;
import com.egzosn.pay.common.bean.PayOrder;
import com.egzosn.pay.common.http.HttpConfigStorage;
import com.egzosn.pay.common.util.sign.SignUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map; /**
* 发起支付入口
*/
@RestController
@RequestMapping("ali")
public class AliPayController { private PayService service = null; @Autowired
private IOrganizationOrderService orderService; @PostConstruct
public void init() {
AliPayConfigStorage aliPayConfigStorage = new AliPayConfigStorage();
//aliPayConfigStorage.setPid("xxx");
aliPayConfigStorage.setAppid("xxx");
aliPayConfigStorage.setKeyPublic("xxx");
aliPayConfigStorage.setKeyPrivate("xxx");
aliPayConfigStorage.setNotifyUrl("xxx");
aliPayConfigStorage.setReturnUrl("xxx"); aliPayConfigStorage.setSignType(SignUtils.RSA2.name());
//aliPayConfigStorage.setSeller("xxx");
aliPayConfigStorage.setInputCharset("utf-8");
//是否为测试账号,沙箱环境
aliPayConfigStorage.setTest(false); //请求连接池配置
HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
//最大连接数
httpConfigStorage.setMaxTotal(20);
//默认的每个路由的最大连接数
httpConfigStorage.setDefaultMaxPerRoute(10);
service = new AliPayService(aliPayConfigStorage, httpConfigStorage);
//增加支付回调消息拦截器
//service.addPayMessageInterceptor(new AliPayMessageInterceptor());
//设置回调消息处理
//service.setPayMessageHandler(spring.getBean(AliPayMessageHandler.class));
} }
1.2、
3.返回顶部
 
4.返回顶部
1、
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/ package javax.annotation; import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*; /**
* The PostConstruct annotation is used on a method that needs to be executed
* after dependency injection is done to perform any initialization. This
* method MUST be invoked before the class is put into service. This
* annotation MUST be supported on all classes that support dependency
* injection. The method annotated with PostConstruct MUST be invoked even
* if the class does not request any resources to be injected. Only one
* method can be annotated with this annotation. The method on which the
* PostConstruct annotation is applied MUST fulfill all of the following
* criteria:
* <p>
* <ul>
* <li>The method MUST NOT have any parameters except in the case of
* interceptors in which case it takes an InvocationContext object as
* defined by the Interceptors specification.</li>
* <li>The method defined on an interceptor class MUST HAVE one of the
* following signatures:
* <p>
* void <METHOD>(InvocationContext)
* <p>
* Object <METHOD>(InvocationContext) throws Exception
* <p>
* <i>Note: A PostConstruct interceptor method must not throw application
* exceptions, but it may be declared to throw checked exceptions including
* the java.lang.Exception if the same interceptor method interposes on
* business or timeout methods in addition to lifecycle events. If a
* PostConstruct interceptor method returns a value, it is ignored by
* the container.</i>
* </li>
* <li>The method defined on a non-interceptor class MUST HAVE the
* following signature:
* <p>
* void <METHOD>()
* </li>
* <li>The method on which PostConstruct is applied MAY be public, protected,
* package private or private.</li>
* <li>The method MUST NOT be static except for the application client.</li>
* <li>The method MAY be final.</li>
* <li>If the method throws an unchecked exception the class MUST NOT be put into
* service except in the case of EJBs where the EJB can handle exceptions and
* even recover from them.</li></ul>
* @since Common Annotations 1.0
* @see javax.annotation.PreDestroy
* @see javax.annotation.Resource
*/
@Documented
@Retention (RUNTIME)
@Target(METHOD)
public @interface PostConstruct {
}
2、
5.返回顶部
 
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Java-Class-@I:javax.annotation.PostConstruct的更多相关文章

  1. Java-API-Package:javax.annotation

    ylbtech-Java-API-Package:javax.annotation 1.返回顶部 1. Package javax.annotation Enum Summary Resource.A ...

  2. JAVA提高五:注解Annotation

    今天我们学习JDK5.0中一个非常重要的特性,叫做注解.是现在非常流行的一种方式,可以说因为配置XML 比较麻烦或者比容易查找出错误,现在越来越多的框架开始支持注解方式,比如注明的Spring 框架, ...

  3. java 编程基础:注解(Annotation Processing Tool)注解处理器 利用注解解读类属性生成XML文件

    APT的介绍: APT(Annotation Processing Tool)是一种注解处理工具,它对源代码文件进行检测,并找出源文件所包含的注解信息,然后针对注解信息进行额外的处理. 使用APT工具 ...

  4. Java学习笔记:注解Annotation

    annotation的概念 In the Java computer programming language, an annotation is a form of syntactic metada ...

  5. 记一次部署时报java.lang.NoSuchMethodError:javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax / persistence / ValidationMode;的解决办法

    楼主在部署war包的时候,本地启动不报错,服务器商报如下问题: Error creating bean with name 'entityManagerFactory' defined in clas ...

  6. java.lang.NoSuchMethodError:javax.validation.BootstrapConfiguration.getClockProviderClassName

    Spring Boot 2随附了hibernate-validator 6(org.hibernate.validator:hibernate-validator:6.0.16.Final依赖于val ...

  7. 【转载:java】详解java中的注解(Annotation)

    目录结构: contents structure [+] 什么是注解 为什么要使用注解 基本语法 4种基本元注解 重复注解 使用注解 运行时处理的注解 编译时处理的注解 1.什么是注解 用一个词就可以 ...

  8. Kubernetes官方java客户端之六:OpenAPI基本操作

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

  9. Spring源码学习之: 通过Spring @PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作

    关于在spring  容器初始化 bean 和销毁前所做的操作定义方式有三种: 第一种:通过@PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作 第二 ...

随机推荐

  1. 优雅的SpringMVC和Restful

    一.前言 1.前段时间一直在写微信小程序的请求,终于把客户端的请求弄好了,可是服务端呢,该怎么写,纠结了半天,用servlet暂时写好了一个:http://www.cnblogs.com/JJDJJ/ ...

  2. python 线程,进程与协程

    引言 线程 创建普通多线程 线程锁 互斥锁 信号量 事件 条件锁 定时器 全局解释器锁 队列 Queue:先进先出队列 LifoQueue:后进先出队列 PriorityQueue:优先级队列 deq ...

  3. ERROR in Error: ***Module is not an NgModule

    引入一个打包的模块时报了这个个错: $ rimraf out Done in 16.81s. lerna ERR! build Errored while running script in 'map ...

  4. Google recaptcha在webform中的使用

    开源项目 https://github.com/tanveery/recaptcha-net   这个的NuGet下载量最高 https://github.com/PaulMiami/reCAPTCH ...

  5. cs224d 作业 problem set2 (一) 用tensorflow纯手写实现sofmax 函数,线性判别分析,命名实体识别

    Hi Dear Today we will use tensorflow to implement the softmax regression and linear classifier algor ...

  6. vue绑值(表格)

    vue绑值(表格) <!DOCTYPE html> <html lang="zh-CN"> <head> <title>JSON取数 ...

  7. 2015 ACM-ICPC 亚洲区上海站 A - An Easy Physics Problem (计算几何)

    题目链接:HDU 5572 Problem Description On an infinite smooth table, there's a big round fixed cylinder an ...

  8. Config JAVA evironment for LoadRunner

    1. Install jdk 2. Set system variables eg. JAVA_HOME = C:\Program Files (x86)\Java\jdk1.6.0_43 class ...

  9. hql例子

    /** * 根据搜索条件查询商品(带缓存) */ public List<ResultInfo> getSearchGoodsList(GoodsTypeCondtionBizBean c ...

  10. C# winform 将其他程序嵌入Form窗体

    嵌入类 public class ExeImpaction { public void FrmClosing() { try { if (!process.HasExited) process.Kil ...