Skip to content

Instantly share code, notes, and snippets.

package uk.me.kissy.oauth2.dataProviders;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.cxf.rs.security.oauth2.provider.JPAOAuthDataProvider;
public class CustomJPAOAuthDataProvider extends JPAOAuthDataProvider {
@PersistenceContext(name = "oauth2")
package tld.domain.example;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
@ApplicationScoped
public class MyApplicationScoped {
@Inject
package uk.me.kissy.oauth2.rs;
import uk.me.kissy.oauth2.dataProviders.JPAOAuthDataProvider;
import org.apache.cxf.jaxrs.ext.MessageContext;
import org.apache.cxf.rs.security.oauth2.grants.owner.JAASResourceOwnerLoginHandler;
import org.apache.cxf.rs.security.oauth2.grants.owner.ResourceOwnerGrantHandler;
import org.apache.cxf.rs.security.oauth2.grants.refresh.RefreshTokenGrantHandler;
import org.apache.cxf.rs.security.oauth2.services.AccessTokenService;
import javax.annotation.PostConstruct;
package uk.me.kissy.sales.producers;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceUnit;
package uk.me.kissy.sales.entities.jpa;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
package uk.me.kissy.sales.entities.jpa.valueHandler;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
package uk.me.kissy.entities.sales.quote;
import java.io.Serializable;
public class Description implements Serializable {
private static final long serialVersionUID = 1L;
private int descriptionId;
private int descriptionTypeId;
private String body;
/**
* 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
package uk.me.kissy.document.templateMethod;
import java.util.List;
import java.util.TreeMap;
import freemarker.template.SimpleNumber;
import freemarker.template.SimpleScalar;
import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;
@chongma
chongma / WebClient1.java
Created September 11, 2018 14:34
example CXF webclient wrapper
package uk.me.kissy.external.utility;
import java.net.URI;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;